This script used to work on an older version of AutoIT. Currently I am running AutoIT v22.214.171.124 and it's failing.
Func PublicIP() ;Post public facing IP address Local $url = 'https://www.google.com/search?client=opera&q=what+is+my+ip&sourceid=opera&ie=UTF-8&oe=UTF-8' Local $getIPaddress = BinaryToString(InetRead($url)) Local $sStart = 'clamp:2">' Local $sEnd = '</div>' Local $ipaddress = _StringBetween($getIPaddress, $sStart, $sEnd For $i In $ipaddress MsgBox(0, 'External IP', "Your public IP address is " & $i) Next EndFunc ;==>PublicIP The console output shows:
"C:\Users\user\Documents\AutoIT\Scripts\WSI Tools.au3" (197) : ==> Variable must be of type "Object".: For $i In $ipaddress For $i In $ipaddress^ ERROR ->14:12:16 AutoIt3.exe ended.rc:1 +>14:12:16 AutoIt3Wrapper Finished. >Exit code: 1 Time: 9.811
Using SQLite, I was trying to select a specific column with having duplicate entries removed by using the DISTINCT function.
Local $sQuery = "SELECT DISTINCT supervisor, COUNT(DISTINCT employee_name) FROM data_db What the above snippet does is just list only one supervisor but with the total count of unique employee names in the whole database when it should be listing out all supervisor entries from the database and list the total count of employees per each supervisors. If I remove the COUNT function, it does list out all unique entries of supervisor names from the list. Attached is a screenshot of an example database as well.
Any help will be much appreciated. Thank you!
I have a script that uses SQLite. It worked without a hiccup on my W7 system.
However, last week I bought a new machine, installed W10 and autoit, and now I'm getting an error during _SQLite_Startup.
Can anyone advise on how to find what's wrong? Tried checking $__g_hPrintCallback_SQLite but that returns nothing.
Tried downloading the latest version of the dll from the link in the function page and I also replaced the default SQLite.dll.au3 that came with AutoIt with the one that came with the latest SQLite version zip.
Relevant parts of my script:
#include <SQLite.au3> #include <SQLite.dll.au3> _SQLite_Startup(@ScriptDir & "\Config\sqlite3_x64.dll", False, 1) If @error Then MsgBox(16, "SQLite Error", "SQLite3.dll Can't be Loaded! - " & $__g_hPrintCallback_SQLite & @CRLF & @CRLF & "Exiting application / Zavolej Honzovi") Exit -1 EndIf
I'm listing the error message strings, and roughly matching the error code
Is this how to do error reporting? Is there a more simple way I don't know about?
I realise I might not need to trap @error inside $error. I like it this way b/c I have no fear of overwriting @error now; I don't even use it.
Func Send_Connect($address, $port) $socket = TCPConnect($address, $port) $error = @error If $error <> 0 Then Local $aError = ["-2 not connected.", _ "1 IPAddr is incorrect.", _ "2 port is incorrect."] $aError = "10060 Connection timed out." If $error < 0 Then $error = 0 If $error > 2 Then $error = 3 MsgBox(0, "TCP Connect Error", $aError[$error], 0) $socket = 0 EndIf Return $socket EndFunc
Good evening everyone
I am building a management for the company I work with, and I just imported a real amount of rows ( about 29000 ), in my SQLite DB.
The thing I am not understanding, is the time that the script takes to build this amount of rows in the ListView.
I didn't measure it, but I think it took 2 minutes or so to create each ListView item...
It is normal that it takes so much time?
What can I do to improve the creation of the items?
Here's the code I am using to query and to create ListView items...
; Articles ListView: Global $lvwArticles = GUICtrlCreateListView("ID|Fornitore|Codice|Descrizione|EU|Prezzo|Sconto Applicato|Note", 14, 87, 1507, 660, BitOR($GUI_SS_DEFAULT_LISTVIEW,$LVS_SORTASCENDING,$LVS_SORTDESCENDING), BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES,$LVS_EX_FULLROWSELECT)) ; Query $strQuery = "SELECT * FROM ARTICOLI;" ; Query Execution _SQLite_GetTable2d($objDatabase, $strQuery, $arrResult, $intRows, $intColumns) If @error Then ; Error Handling Else ; Cleaning the ListView _GUICtrlListView_DeleteAllItems($lvwArticles) If @error Then ; Error Handling Else ; No records in the Table If UBound($arrResult) < 2 Then ; Error Handling Else _GUICtrlListView_BeginUpdate($lvwArticles) For $intCounter = 1 To UBound($arrResult) - 1 $strListViewItem = $arrResult[$intCounter] & "|" & _ $arrResult[$intCounter] & "|" & _ $arrResult[$intCounter] & "|" & _ $arrResult[$intCounter] & "|" & _ $arrResult[$intCounter] & "|" & _ $arrResult[$intCounter] & "|" & _ $arrResult[$intCounter] & "|" & _ $arrResult[$intCounter] $objListViewItem = GUICtrlCreateListViewItem($strListViewItem, $lvwArticles) Next _GUICtrlListView_EndUpdate($lvwArticles) EndIf EndIf EndIf Thanks in advance