Custom Query (3910 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (328 - 330 of 3910)

Ticket Resolution Summary Owner Reporter
#1124 Fixed _Date_Time_SystemTimeTo*Str() Errors with bFmt = 1 J-Paul Mesnage wraithdu
Description

Both the _Date_Time_SystemTimeToDateTimeStr() and _Date_Time_SystemTimeToDateStr() functions return the wrong date format when bFmt = 1. They return the date in yyyy/dd/mm instead of the documented yyyy/mm/dd. bFmt = 0 correctly returns mm/dd/yyyy though.

#1125 Fixed StringRegExpReplace fails for case insensitive group (?i...) J-Paul Mesnage martin
Description

This example

;replace the 2nd parameter using case insensitivity for the whole match
$res1 = StringRegExpReplace("$gui = GuiCreate($a,$b,$c)","(?i)(\$gui\s*=\s*guicreate\([^,]*,)([^,]*,)(.*)","$1 800,$3")
ConsoleWrite("Result 1 >" & $res1 & @CRLF)

;same change but set case insensitivity for first group only, should give same result
$res2 = StringRegExpReplace("$gui = GuiCreate($a,$b,$c)","(?i\$gui\s*=\s*guicreate\([^,]*,)([^,]*,)(.*)","$1 800,$3")
ConsoleWrite("Result 2 >" & $res2 & @CRLF)

gives this result

Result 1 >$gui = GuiCreate($a, 800,$c)
Result 2 >$gui = GuiCreate($a,$b,$c)

I think Result 2 should be the same as result 1.

Discussed http://www.autoitscript.com/forum/index.php?showtopic=100147&view=findpost&p=716575.

#1134 Fixed Code cleanup of _FileWriteToLine() J-Paul Mesnage partypooper@…
Description

Just a slight code clean-up by reducing the number of lines required for the function to operate.

; #FUNCTION# ====================================================================================================================
; Name...........: _FileWriteToLine
; Description ...: Writes text to a specific line in a file.
; Syntax.........: _FileWriteToLine($sFile, $iLine, $sText[, $fOverWrite = 0])
; Parameters ....: $sFile      - The file to write to
;                  $iLine      - The line number to write to
;                  $sText      - The text to write
;                  $fOverWrite - If set to 1 will overwrite the old line
;                  |If set to 0 will not overwrite
; Return values .: Success - 1
;                  Failure - 0
;                  @Error  - 0 = No error
;                  |1 = File has less lines than $iLine
;                  |2 = File does not exist
;                  |3 = Error when opening file
;                  |4 = $iLine is invalid
;                  |5 = $fOverWrite is invalid
;                  |6 = $sText is invalid
; Author ........: cdkid
; Modified.......: partypooper - code cleanup
; Remarks .......: If _FileWriteToLine is called with $fOverWrite as 1 and $sText as "", it will delete the line.
; Related .......:
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func _FileWriteToLine($sFile, $iLine, $sText, $fOverWrite = 0)
	If $iLine <= 0 Then Return SetError(4, 0, 0)
	If Not IsString($sText) Then Return SetError(6, 0, 0)
	If $fOverWrite <> 0 And $fOverWrite <> 1 Then Return SetError(5, 0, 0)
	If Not FileExists($sFile) Then Return SetError(2, 0, 0)
	Local $filtxt = FileRead($sFile, FileGetSize($sFile))
	$filtxt = StringSplit($filtxt, @CRLF, 1)
	If UBound($filtxt, 1) < $iLine Then Return SetError(1, 0, 0)
	Local $fil = FileOpen($sFile, 2)
	If $fil = -1 Then Return SetError(3, 0, 0)
	For $i = 1 To UBound($filtxt) - 1
		If $i = $iLine Then
			If Not $fOverWrite Then ; overwrite option 'off'
				FileWrite($fil, $sText & @CRLF) ; insert new line
				FileWrite($fil, $filtxt[$i] & @CRLF) ; write old line after new
			Else ; overwrite option 'on'
				If $sText <> "" Then FileWrite($fil, $sText & @CRLF) ; write new line in place of old
			EndIf
		ElseIf $i < UBound($filtxt, 1) - 1 Then
			FileWrite($fil, $filtxt[$i] & @CRLF)
		ElseIf $i = UBound($filtxt, 1) - 1 Then
			FileWrite($fil, $filtxt[$i])
		EndIf
	Next
	FileClose($fil)
	Return 1
EndFunc   ;==>_FileWriteToLine

Batch Modify
Note: See TracBatchModify for help on using batch modify.
Note: See TracQuery for help on using queries.