Custom Query (3927 matches)
Results (187 - 189 of 3927)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #188 | Rejected | Try...Catch | ||
| Description |
Hi! I thought maybe a Try...Catch feature would be cool to have for AutoIt. |
|||
| #189 | Fixed | #Include Conflict: Constants.au3 + ScrollBarConstants.au3 = Duplicates | ||
| Description |
#include <Constants.au3> #include <ScrollBarConstants.au3> C:\PROGRA~1\AutoIt3\Include\ScrollBarConstants.au3 (45) : ==> Can not redeclare a constant.: Global Const $OBJID_HSCROLL = 0xFFFFFFFA Global Const ^ ERROR They both set $OBJID_HSCROLL, $OBJID_VSCROLL, and $OBJID_CLIENT. Lines 273-275 in Constants.au3 and lines 45-47 in ScrollBarConstants.au3 I noticed this when I went to use _GUICtrlEdit_Scroll(), and so included ScrollBarConstants.au3, but already had Constants.au3 included for other purposes. For now I'm just declaring the particular constants I need and not including the scrollbar file. |
|||
| #190 | Duplicate | _SQLite_GetTable2d crashes script if column field is null or unset | ||
| Description |
I have incurred a fatal error that occurs during the call to _SQLite_GetTable2d. The error occurs when I have a null or unset (not sure what the SQLite terminology is) value in one of the columns of a row of data. The following script will produce the error #include <SQLite.au3>
#include <SQLite.dll.au3>
Local $hQuery, $aResult, $iRows, $iColumns
_SQLite_Startup ()
_SQLite_Open () ; open :memory: Database
_SQLite_Exec (-1, "CREATE TABLE aTest (a,b,c);")
_SQLite_Exec (-1, "INSERT INTO aTest(a,b,c) VALUES ('no','columns','null');")
_SQLite_Exec (-1, "INSERT INTO aTest(a,c) VALUES ('missing','b');")
If _SQLite_GetTable2d(-1, "SELECT ROWID,* FROM aTest;", $aResult, $iRows, $iColumns) = $SQLITE_OK Then
_SQLite_Display2DResult($aResult)
EndIf
_SQLite_Exec (-1, "DROP TABLE aTest;")
_SQLite_Close ()
_SQLite_Shutdown ()
If you remove the line: _SQLite_Exec (-1, "INSERT INTO aTest(a,c) VALUES ('missing','b');")
the script executes as expected. I narrowed the error down to an internal function call (_SQLite_szStringRead) within the _SQLite_GetTable2d function: Func __SQLite_szStringRead($iszPtr, $iLen = -1)
Local $aStrLen, $vszString
If $iszPtr < 1 Then Return ""
If $iLen < 1 Then
If $g_avSafeMode_SQLite[3] < 1 Then $g_avSafeMode_SQLite[3] = DllOpen("msvcrt.dll")
$aStrLen = DllCall($g_avSafeMode_SQLite[3], "int:cdecl", "strlen", "ptr", $iszPtr)
If @error Then Return SetError(1, 0, "")
$iLen = $aStrLen[0] + 1
EndIf
$vszString = DllStructCreate("char[" & $iLen & "]", $iszPtr)
If @error Then Return SetError(2, 0, "")
Return SetError(0, $iLen, DllStructGetData($vszString, 1))
EndFunc ;==>__SQLite_szStringRead
In the case of a null or unset value, the line: If $iszPtr < 1 Then Return "" should evaluate as true as the value of $iszPtr is always 0. However, this is not the case and I have found that changing the line to: If $iszPtr < 1 Or $iszPtr = 0 Then Return "" will fix the problem. |
|||
