Custom Query (3926 matches)
Results (187 - 189 of 3926)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #2514 | Fixed | _FileWriteFromArray - Count of elements in 2nd dimension is fixed to 3! | ||
| Description |
If you write an 2D-Array with more than 3 elements in columns, you get only 3 columns in the resulting file. I've found the error: The count of dimensions is detected with Local $iDims = UBound($a_Array, 0) Thats right, but than this value will also used as count of columns: Case 2 Local $s_Temp For $x = $i_Base To $i_UBound $s_Temp = $a_Array[$x][0] For $y = 1 To $iDims And so the file creating stops after 3rd column is reached. Btw. In my mind it's slowly to write the file line by line. Better way is collect the stuff and write it at once. Here is my correct working and faster version of _FileWriteFromArray: Func _FileWriteFromArray($File, $a_Array, $i_Base = 0, $i_UBound = 0, $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 If $i_UBound < 1 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 $s_Temp = '', $ErrorSav = 0 Switch $iDims Case 1 For $x = $i_Base To $i_UBound $s_Temp &= $a_Array[$x] & @CRLF Next If FileWrite($hFile, $s_Temp) = 0 Then $ErrorSav = 3 Case 2 For $x = $i_Base To $i_UBound $s_Temp &= $a_Array[$x][0] ;~ For $y = 1 To $iDims ; == FAILURE -- we need "Ubound($a_Array, 2) -1" !! For $y = 1 To Ubound($a_Array, 2) -1 $s_Temp &= $s_Delim & $a_Array[$x][$y] Next $s_Temp &= @CRLF Next If FileWrite($hFile, $s_Temp) = 0 Then $ErrorSav = 3 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 |
|||
| #3692 | Wont Fix | SciTE v. 4.1.2.0 - the function luaL_register has removed | ||
| Description |
Because luaL_register has removed, it's impossible to use external dll inside SciTE (i.e. shell.dll, lfs.dll, gui.dll).
So a lot of helpful additions for SciTE, written by several users, are useless over night.
To reproduce:
Copy one of this dll files in your user lua directory (i.e. shell.dll:https://scite-ru.bitbucket.io/pack/tools/LuaLib/shell.html).
Create in SciTEUser.properties: local sUserLua = props["Lua.User.Scripts.Path"]
LUA_USER_PATH = sUserLua .. "\\?.dll;" .. sUserLua .. "\\?\\?.dll;"
package.cpath = LUA_USER_PATH .. package.cpath
require "shell"
if shell then
table.foreach(shell, print)
end
Restart SciTE. In older versions of SciTE, all components of the shell.dll will print out while starting SciTE. But now you get an error message "procedure entry point 'luaL_register' not found in 'shell.dll'". This is not the truth - the entry point is missing in "SciTE4.1.2.0.exe". Was removing LuaL_register an oversight or intention? If the latter is true, why? |
|||
| #3726 | Works For Me | _WinAPI_PathGetArgs / _WinAPI_PathRemoveArgs -- using like the help example can lead to errors | ||
| Description |
The help example for the _WinAPI_PathGetArgs and _WinAPI_PathRemoveArgs functions uses the _WinAPI_AssocQueryString function as the source for the command line. However, this can lead to errors if the path of the executable is not enclosed in string delimiters. The Remarks specifically mention not to use such features ("This function should not be used on generic command path templates (from users or the registry)"). But in the example the function _WinAPI_AssocQueryString is used, which accesses the registry. The following can happen: #include <WinAPIShPath.au3>
#include <APIRegConstants.au3>
#include <WinAPIReg.au3>
Local $sCmd = _WinAPI_AssocQueryString('.profile', $ASSOCSTR_COMMAND)
ConsoleWrite('$sCmd: ' & $sCmd & @CRLF) ; TRUE --> C:\Program Files\Intel\bin\iWrap.exe /CMD:7 %1
Local $sPath = _WinAPI_PathRemoveArgs($sCmd)
ConsoleWrite("$sPath: " & $sPath & @LF) ; FALSE --> C:\Program
Local $sArgs = _WinAPI_PathGetArgs($sCmd)
ConsoleWrite("$sArgs: " & $sArgs & @LF) ; FALSE --> Files\Intel\bin\iWrap.exe /CMD:7 %1
I would recommend using a defined path for the help example, instead of _WinAPI_AssocQueryString. Local $sCmd = '"C:\Program Files\Intel\bin\iWrap.exe" /CMD:7 %1' |
|||
