Search the Community
Showing results for tags 'type'.
-
#include <SQLite.au3> ;~ #include <SQLite.dll.au3> Local $hQuery, $aRow, $aNames _SQLite_Startup() ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF) _SQLite_Open() ; open :memory: Database _SQLite_Exec(-1, "CREATE TABLE aTest (A,B int not null unique ,C text);") _SQLite_Exec(-1, "INSERT INTO aTest(a,b,c) VALUES ('c','2','World');") _SQLite_Exec(-1, "INSERT INTO aTest(a,b,c) VALUES ('b','3',' ');") _SQLite_Exec(-1, "INSERT INTO aTest(a,b,c) VALUES ('a','1','Hello');") _SQLite_Query(-1, "SELECT _ROWID_,* FROM aTest ORDER BY a;", $hQuery) _SQLite_FetchTypes($hQuery, $aNames) ; Read out Column Types ConsoleWrite(StringFormat(" %-10s %-10s %-10s %-10s ", $aNames[0], $aNames[1], $aNames[2], $aNames[3]) & @CRLF) _SQLite_FetchNames($hQuery, $aNames) ; Read out Column Names ConsoleWrite(StringFormat(" %-10s %-10s %-10s %-10s ", $aNames[0], $aNames[1], $aNames[2], $aNames[3]) & @CRLF) While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK ConsoleWrite(StringFormat(" %-10s %-10s %-10s %-10s ", $aRow[0], $aRow[1], $aRow[2], $aRow[3]) & @CRLF) WEnd _SQLite_Exec(-1, "DROP TABLE aTest;") _SQLite_Close() _SQLite_Shutdown() ; Output: ; INTEGER int text ; rowid A B C ; 3 a 1 Hello ; 2 b 3 ; 1 c 2 World Func _SQLite_FetchTypes($hQuery, ByRef $aTypes) Dim $aTypes[1] If __SQLite_hChk($hQuery, 3, False) Then Return SetError(@error, 0, $SQLITE_MISUSE) Local $avDataCnt = DllCall($__g_hDll_SQLite, "int:cdecl", "sqlite3_column_count", "ptr", $hQuery) If @error Then Return SetError(1, @error, $SQLITE_MISUSE) ; DllCall error If $avDataCnt[0] <= 0 Then Return SetError(-1, 0, $SQLITE_DONE) ReDim $aTypes[$avDataCnt[0]] Local $avColName For $iCnt = 0 To $avDataCnt[0] - 1 $avColName = DllCall($__g_hDll_SQLite, "wstr:cdecl", "sqlite3_column_decltype16", "ptr", $hQuery, "int", $iCnt) If @error Then Return SetError(2, @error, $SQLITE_MISUSE) ; DllCall error $aTypes[$iCnt] = $avColName[0] Next Return $SQLITE_OK EndFunc ;==>_SQLite_FetchTypes If you wanna build a proper JSON string, you may want to know if is {"int":123} or {"text":"123"} and for that, this can help, obviously only when declared in the SQLite table.
- 3 replies
-
- _sqlite_fetchtypes
- sqlite
-
(and 1 more)
Tagged with:
-
Why this kind of code below, getting the tag name's element of the ID's element: #include <IE.au3> $oIE = _IECreate("http://www.example.com/", 0, 1, 1) Sleep(5000) $element = $oIE.document.getElementById("element_id") $tags = $element.getElementsByTagName("IFRAME") For $tag In $tags $msg = $tag.contentWindow.document.body MsgBox(0, "Message", $msg.innerHTML) Next And also this code, getting the class name's element of the ID's element: #include <IE.au3> $oIE = _IECreate("http://www.example.com/", 0, 1, 1) Sleep(5000) $element = $oIE.document.getElementById("element_id") $classes = $element.getElementsByClassName("class_name") For $class In $classes $msg = $class MsgBox(0, "Message", $msg.innerHTML) Next Returns the error 'Variable must be of type "Object".': Variable must be of type "Object".: MsgBox(0, "Message", $msg.innerHTML) MsgBox(0, "Message", $msg^ ERROR Instead of the inner HTML sources of the tag name's elements and the class name's elements? What is the right way to do those?
- 2 replies
-
- getElementById
- getElementsByClassName
- (and 6 more)
-
How to click the tag <input type="submit" name="submit" id="submit" value="Publish this ad"> on this kind of form? <form name="publish_form" id="publish_form" method="post" action="http://www.example.com/jobs/publish/xxxxx/"> <fieldset> <div class="right"> <div class="suggestion">If you changed your mind, you may <a href="http://www.example.com/jobs/deactivate/xxxxx/" title="cancel posting this ad">cancel posting this ad</a></div> </div> <input type="submit" name="submit" id="submit" value="Publish this ad"> or <a href="http://www.example.com/jobs/post/xxxxx/" title="Edit it">Edit it</a> </fieldset> </form> I already tried this code: #include <IE.au3> Local $oForm = _IEFormGetObjByName($oIE, "publish_form") Sleep(2000) _IEFormSubmit($oForm) But it caused a problem: --> IE.au3 T3.0-1 Error from function _IEFormSubmit, $_IEStatus_COMError (-2147352573) Is there any other way to submit that kind of form?