Custom Query
Results (10 - 12 of 3866)
Ticket | Resolution | Summary | Owner | Reporter |
---|---|---|---|---|
#42 | Fixed | _FileWriteFromArray outputs too many CRLF (File.au3) | Gary | mlowery <matin@…> |
Description |
Lines output from the _FileWriteFromArray function in the standard File.au3 include are prefixed by a @CRLF, resulting in an initial blank line in the file. Repeated use of this function and its complement _FileReadToArray on the same file can result in file bloating. A suggested fix is to change the current file writing loop: Local $ErrorSav = 0 For $x = $i_Base To $i_UBound If FileWrite($hFile, @CRLF & $a_Array[$x]) = 0 Then $ErrorSav = 3 ExitLoop EndIf Next With something such as below that outputs the CRLF after the data, and does not write a final CRLF (code could undoubtedly be improved): Local $ErrorSav = 0 For $x = $i_Base To $i_UBound -1 If FileWriteLine($hFile, $a_Array[$x]) = 0 Then $ErrorSav = 3 ExitLoop EndIf Next If FileWrite($hFile, $a_Array[$i_UBound]) = 0 Then $ErrorSav = 3 As an additional suggestion, modify the function call to take the array by reference: _FileWriteFromArray($File, ByRef $a_Array, $i_Base = 0, $i_UBound = 0) Thanks! |
|||
#43 | Fixed | IniReadSectionNames returning incorrect number of sections (extra blank section) | lte5000 | |
Description |
IniReadSectionNames returns an extra blank section that does not exist in the INI file. This behavior occurs on Windows 98 SE. The function returns the correct number of sections on Windows XP SP2. Example: FileDelete("test.ini") IniWrite("test.ini", "section1", "key1", "abc") $var = IniReadSectionNames("test.ini") MsgBox(0, "how many sections", $var[0]) For $i = 1 To $var[0] MsgBox(0, "section #" & $i, $var[$i]) Next |
|||
#46 | Fixed | Wrong example _ArrayTrim in help | Gary | Emiel Wieldraaijer |
Description |
#include <Array.au3> Dim $avArray[5] $avArray[0] = "ab" $avArray[1] = "bc" $avArray[2] = "cd" $avArray[3] = "de" $avArray[4] = "ef" $aNewArray = _ArrayTrim( $avArray, 1, 1,1,3) _ArrayDisplay($aNewArray,"demo _ArrayTrim") Exit ;The new array in order should now be "a", "b" , "c" , "d", "e". Should Be #include <Array.au3> Dim $avArray[5] $avArray[0] = "ab" $avArray[1] = "bc" $avArray[2] = "cd" $avArray[3] = "de" $avArray[4] = "ef" $aNewArray = _ArrayTrim( $avArray, 1, 1,0,4) _ArrayDisplay($aNewArray,"demo _ArrayTrim") Exit ;The new array in order should now be "a", "b" , "c" , "d", "e". _ArrayTrim( $avArray, 1, 1,0,4) instead of _ArrayTrim( $avArray, 1, 1,1,3) |