Custom Query

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (82 - 84 of 3868)

Ticket Resolution Summary Owner Reporter
#503 Fixed _Date_Time_FileTimeToLocalFileTime() - Helpfile example is incorrect Gary cbruce
Description

The helpfile example uses _Date_Time_EncodeFileTime() to create an initial value to work with. The problem is that this creates a LOCAL time value and not a UTC time value.

Since FileTimes are stored as UTC time, when _Date_Time_FileTimeToLocalFileTime() is passed a LOCAL time value, it applies the UTC to LOCAL conversion and the returned value is not what was intended.

Here's the example with corrections:

*

#include <GuiConstantsEx.au3>
#include <Date.au3>
#include <WindowsConstants.au3>

Global $iMemo

_Main()

Func _Main()
	;	---------------  FROM  ---------------
	;Local $hGUI, $tFile, $tLocal
	;	---------------   TO   ---------------
	Local $hGUI, $tSystem, $tFile, $tLocal
	;	--------------------------------------

	; Create GUI
	$hGUI = GUICreate("Time", 400, 300)
	$iMemo = GUICtrlCreateEdit("", 2, 2, 396, 296, $WS_VSCROLL)
	GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
	GUISetState()

	;	---------------  FROM  ---------------
	;; Encode a file time
	;$tFile  = _Date_Time_EncodeFileTime(@MON, @MDAY, @YEAR, @HOUR, @MIN, @SEC)
	;	---------------   TO   ---------------
	; Get system time
	$tSystem = _Date_Time_GetSystemTime()
	$tFile   = _Date_Time_SystemTimeToFileTime(DllStructGetPtr($tSystem))
	;	--------------------------------------
	$tLocal = _Date_Time_FileTimeToLocalFileTime(DllStructGetPtr($tFile))
	MemoWrite("Local file time .: " & _Date_Time_FileTimeToStr($tLocal))

	; Loop until user exits
	Do
	Until GUIGetMsg() = $GUI_EVENT_CLOSE

EndFunc   ;==>_Main

; Write a line to the memo control
Func MemoWrite($sMessage)
	GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite

*

Thank you all for your time and effort.

Respectfully, Bruce Huber

#506 Fixed _FileCountLines Gary Xenobiologist
Description

Same problem as I mentioned before with _FileReadToArray. The function _FileCountLines should deal all common line-end-chars. LF, CR, CRLF.

I changed it to this:

; #FUNCTION# ====================================================================================================================
; Name...........: _FileCountLines
; Description ...: Returns the number of lines in the specified file.
; Syntax.........: _FileCountLines($sFilePath)
; Parameters ....: $sFilePath - Path and filename of the file to be read
; Return values .: Success - Returns number of lines in the file.
;                  Failure - Returns a 0
;                  @Error  - 0 = No error.
;                  |1 = File cannot be opened or found.
;                  |2 = Unable to Split the file
; Author ........: Tylo <tylo at start dot no>
; Modified.......: Xenobiologist
; Remarks .......: It does not count a final @LF as a line.
; Related .......:
; Link ..........;
; Example .......; Yes
; ===============================================================================================================================

Func __FileCountLines($sFilePath)
	Local $hFile, $sFileContent, $aTmp
	$hFile = FileOpen($sFilePath, 0)
	If $hFile = -1 Then Return SetError(1, 0, 0)
	$sFileContent = StringStripWS(FileRead($hFile, FileGetSize($sFilePath)), 2)
	FileClose($hFile)
	If StringInStr($sFileContent, @LF) Then
		$aTmp = StringSplit(StringStripCR($sFileContent), @LF)
	ElseIf StringInStr($sFileContent, @CR) Then
		$aTmp = StringSplit($sFileContent, @CR)
	Else
		Return SetError(2, 0, 0)
	EndIf
	Return $aTmp[0]
EndFunc   ;==>__FileCountLines
#507 No Bug Problem with GuiToolTip UDF functions using only TTM_*W message constants. Gary Bowmore
Description

Win XP Pro Sp2 AutoIt 3.2.13.7 Last known working version AutoIt 2.2.10.0

Changes made since AutoIt version 3.2.10.0 to this UDF to use only the TTM_*W version of messages have resulted in some of the functions no longer working on some third party applications. I've tried the simple test script attached on many different applications with the following results.

Using the TTM_*W messages works on most but not all applications

Using the TTM_*A messages works on all applications that TTM_*W messages works on plus some that TTM_*W messages do not work on.

I've created the attached test script to displays tooltip info for toolbar buttons using modified versions of the GUI_ToolTips functions _GUIToolTip_EnumTools() and _GUIToolTip_GetText() to demonstrate the effect of using both ANSI (Hotkey 1) and Wide messages (Hotkey 2)

The only commonly available application I've been able to find that shows the behaviour I have observed is AutoIt3\SciTE\AutoItMacroGenerator\AutoItMacroGenerator02.exe

Note: See TracQuery for help on using queries.