I have a question please
Can we customize error messages in autoit script?
I mean internal error messages
Line 4 (File "D:\my projects\NVDA Manager\New AutoIt v3
$script = 1
Error: Subscript used on non-accessible variable.
For example, I want to customize this message
Is this possible?
am waiting for your answers
I'm trying to make a program that can look at a folder directory, find all the CSV files, and then add the data from CSV's to an array.
The problem I seem to be running into is on the 2nd iteration (2nd file) when the script will not create an array. Could someone please help? Thanks in advance
#include <Array.au3> #include <File.au3> #include <MsgBoxConstants.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> Global $MasterArray RefineData() Func RefineData() Local $i, $filenum, $file, $csvArray, $sFilePath = @ScriptDir $fileList = _FileListToArrayRec($sFilePath, "*.csv", 1) ;Create and array of all .csv files within folder ;=====Loop through the .csv files within the folder====== For $filenum = 1 To UBound($fileList) - 1 Step 1 $file = $fileList[$filenum] $sFilePath = $sFilePath & "\" & $file ;=====Create array based on csv file===== _FileReadToArray($sFilePath, $csvArray, $FRTA_NOCOUNT, ",") _ArrayDisplay($csvArray,"File: " & $filenum) If $filenum = 1 Then $MasterArray = $csvArray _ArrayDisplay($MasterArray, "Master") Else $MasterArray = _ArrayColInsert($MasterArray, UBound($MasterArray)) ;want column added at end For $i = 0 To UBound($MasterArray)-1 Step 1 $MasterArray[$i][UBound($MasterArray) - 1] = $csvArray[$i] Next _ArrayDisplay($MasterArray, "Master") EndIf Next EndFunc ;==>RefineData
In the autoit file, if we add multiple libraries (both internal and custom created one)
When we compile the code and run the exe, some time we are getting runtime errors.
But the line number of error is not showing the exact line number, might be it is including the line number count of libraries also.
Can you please suggest how to get the exact error line number.
So, it will be useful for debugging.
i have seen many pointing out issues related to this, i tried reading through them - still unable to solve mine.. i have a script which reads certain lines based on a search item, this is an iterative process - the ldflst_file gets updated for each iteration and the script finds the line number which has the search item. this works perfectly for few iterations, but stops in some cases abruptly with the error =
Subscript used on non-accessible variable $aRead^ ERROR I have verified that the search item is present in the file. what could be the reason for this code to stop in certain cases. thanks for help
my code below (partial).. full code is in attachment
global $ldflst_var1=" JOINT LOAD FORCE(X) FORCE(Y) FORCE(Z) MOMENT(X) MOMENT(Y) MOMENT(Z)"
for $i= 0 to $ldflst_totlines ; ldflst_totlines is total number of lines in the file 'ldflst_file'
if $aRead[$i]=$ldflst_var1 Then
In my recent project I'm downloading a bunch of data, so I decided to store it in a SQLite database. NOTE: I'm using sqlite3_x64.dll
Everything is working just fine but I'm struggling with getting the Median value. SQLite has an Average function but not a Median one.
I googled but all of the provided solutions are way above my pay-grade. After some more searching I found 'extension-functions.c' on the SQLite site where Median is included. After almost an hour of struggling I was able to successfully compile it into a DLL.
So I downloaded @jchd's SQLiteExtLoad.au3 as seen here:
But I'm getting these errors:
"Path\SQLiteExtLoad.au3"(21,40) : warning: $g_hDll_SQLite: possibly used before declaration. Local $RetVal = DllCall($g_hDll_SQLite, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "Path\SQLiteExtLoad.au3"(21,40) : error: $g_hDll_SQLite: undeclared global variable. Local $RetVal = DllCall($g_hDll_SQLite, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ So I tried, copying the function to my file and changing the DLL variable ($g_hDll_SQLite) directly to the DLL location (C:\...\.. .dll), but now this error fires
If __SQLite_hChk($hConn, 1) Then Return SetError(@error, 0, $SQLITE_MISUSE) To be honest, I don't know what to use as the $hConn - handle of connection.
I would appreciate any help, be it getting the median using SQLite queries or getting the DLL extension loaded using AutoIt.
EDIT: well, I suspect the $hConn variable refers to the return value of the _SQLite_Open function. Well, at least now _SQLite_EnableExtensions doesn't give errors. Now I run into problems with _SQLite_LoadExtension, which gives error -1, and extended 1. Apparently the 1 constant is a generic error where other error do not apply.
BTW, anybody knows whether I need to compile the extension DLL "into" x64 when I use a x64 SQLite? That might be the problem...
EDIT2: I recompiled the dll and tried it using the SQLite3.exe and it works, so I'm confident the extension DLL has been created correctly