Custom Query

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (169 - 171 of 3856)

Ticket Resolution Summary Owner Reporter
#2242 Fixed _FileWriteFromArray is incapable of writing only the zeroth element guinness BrewManNH
Description

In the File.au3 UDF, the function _FileWriteFromArray can't be used to write only the zeroth [0] of an array due to the way it is written. It has the capability to write any other single element, such as [1] or [2], but you can't output to a file the first element.

There is a simple fix for it, but it would be a script breaking change if applied.

; <<< default value for $I_Ubound changed to -1 instead of 0 >>>
Func _FileWriteFromArray($File, $a_Array, $i_Base = 0, $i_UBound = -1, $s_Delim = "|")
	; Check if we have a valid array as input
	If Not IsArray($a_Array) Then Return SetError(2, 0, 0)
	Local $iDims = UBound($a_Array, 0)
	If $iDims > 2 Then Return SetError(4, 0, 0)

	; determine last entry
	Local $last = UBound($a_Array) - 1
; <<< This line changed to look for the value of $i_Ubound < 0 instead of $i_Ubound < 1 >>>
	If $i_UBound < 0 Or $i_UBound > $last Then $i_UBound = $last
	If $i_Base < 0 Or $i_Base > $last Then $i_Base = 0

	; Open output file for overwrite by default, or use input file handle if passed
	Local $hFile
	If IsString($File) Then
		$hFile = FileOpen($File, $FO_OVERWRITE)
	Else
		$hFile = $File
	EndIf
	If $hFile = -1 Then Return SetError(1, 0, 0)

	; Write array data to file
	Local $ErrorSav = 0
	Switch $iDims
		Case 1
			For $x = $i_Base To $i_UBound
				If FileWrite($hFile, $a_Array[$x] & @CRLF) = 0 Then
					$ErrorSav = 3
					ExitLoop
				EndIf
			Next
		Case 2
			Local $s_Temp
			For $x = $i_Base To $i_UBound
				$s_Temp = $a_Array[$x][0]
				For $y = 1 To $iDims - 1
					$s_Temp &= $s_Delim & $a_Array[$x][$y]
				Next
				If FileWrite($hFile, $s_Temp & @CRLF) = 0 Then
					$ErrorSav = 3
					ExitLoop
				EndIf
			Next
	EndSwitch

	; Close file only if specified by a string path
	If IsString($File) Then FileClose($hFile)

	; Return results
	If $ErrorSav Then Return SetError($ErrorSav, 0, 0)
	Return 1
EndFunc   ;==>_FileWriteFromArray

It's only 2 values in 2 lines that need to be changed, but would result in it being a script breaking change due to this.

#2297 Fixed Tidy copying last line(s) of script to top of the script Jos BrewManNH
Description

Occasionally when I run Tidy on a script, with or without any custom settings for Tidy, I will get the last line or 2 posted to the top of the script

#endregion Function listing
;  
; 
; 
#region ;**** Directives created by AutoIt3Wrapper_GUI ****

The #endregion directive is actually the last line of my script, and it got stuck up at the top of the script. Sometimes the line that gets put at the top of the script is missing from the file after the Tidy process has finished, most of the time it's still there, just copied.

This doesn't happen everytime I use it, but it happens frequently enough that I figured I should let someone know about it.

Also, this happens on large or small scripts of only a few lines. It also doesn't matter which OS I'm using as it happens on XP (x86), Vista (x64 and x86) and Windows 7 (x64 and x86).

#2320 Fixed _IENavigate return values guinness BrewManNH
Description

It appears from looking at the _IENavigate function that the return values from it don't match with the description in the help file. The function is supposed to return a value of -1 if it was successful, and 0 if there was a problem.

This section returns -1 with @error set if any errors are encountered in the _IELoadWait function and are passed from _IENavigate as a success, but with the @error value set to the error.

If $f_wait Then
	_IELoadWait($o_object)
	Return SetError(@error, 0, -1)
EndIf
Note: See TracQuery for help on using queries.