Mbee Posted September 16, 2019 Posted September 16, 2019 Obviously, I've got either a design flaw or a bug in my code -- I'm NOT blaming AutoIt for this. But I would have thought it would be impossible for an array to look like this: An array that's one-dimensional for the first four elements, then suddenly a two-dimensional array that over-writes element zero! WTF? That display is from the graphical debugger. It would be easier to track down my bug if I knew how to identify that an array is suddenly hyperdimensional (I have no idea what to call this). Then I could backtrack the change. Or perhaps you might know what the code might look like to create such an abomination? I apologize that I keep finding these weirdies!
water Posted September 16, 2019 Posted September 16, 2019 I'm quite sure you can't create an array in AutoIt that changes its dimensions. I fear it is a bug in the de-bugger You could use AutoIt to write information about the array to the Console: ConsoleWrite("#of dimensions: " & UBound($arg_Ara, 0) & @CRLF) ConsoleWrite("#of rows : " & UBound($arg_Ara, 1) & @CRLF) ConsoleWrite("#of columns : " & UBound($arg_Ara, 2) & @CRLF) ConsoleWrite("Value of $arg_Ara[0]: " & $arg_Ara[0]) & @CRLF) ; I'm sure you'll get an error on this statement My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Gianni Posted September 16, 2019 Posted September 16, 2019 Couldn't it also be an array in array? Some time ago I wrote a function to see the "structure" and the content of an array. Try to pass that array to that function that you can find here: https://www.autoitscript.com/forum/topic/182856-array-viewer/ Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
jchd Posted September 16, 2019 Posted September 16, 2019 This debugger behaves as a D-bugger, a Dramatic source of (visual) bug creation. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
Mbee Posted September 16, 2019 Author Posted September 16, 2019 16 hours ago, water said: I'm quite sure you can't create an array in AutoIt that changes its dimensions. I fear it is a bug in the de-bugger You could use AutoIt to write information about the array to the Console: ConsoleWrite("#of dimensions: " & UBound($arg_Ara, 0) & @CRLF) ConsoleWrite("#of rows : " & UBound($arg_Ara, 1) & @CRLF) ConsoleWrite("#of columns : " & UBound($arg_Ara, 2) & @CRLF) ConsoleWrite("Value of $arg_Ara[0]: " & $arg_Ara[0]) & @CRLF) ; I'm sure you'll get an error on this statement Thank you greatly, @water You were correct in predicting that bottom statement wouldn't fly, but here's the output from the first three: #of dimensions: 1 #of rows : 1 #of columns : 0
jchd Posted September 16, 2019 Posted September 16, 2019 You can use this to dump variables. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
Mbee Posted September 16, 2019 Author Posted September 16, 2019 5 hours ago, Chimp said: Couldn't it also be an array in array? Some time ago I wrote a function to see the "structure" and the content of an array. Try to pass that array to that function that you can find here: https://www.autoitscript.com/forum/topic/182856-array-viewer/ I very much appreciate your reply, @Chimp Your code looks awesome as hell! Unfortunately, I keep running into problems trying to run it. Most of them were solved by adding a "Local" declaration to a few variable assignments. But that didn't work with the current fail point, which is here (I added the "Local") : In Func __GUICtrlTreeView_AddItem: Local $tInsert = DllStructCreate($tagTVINSERTSTRUCT) "Error: Variable used without being declared" Any advice, please?
Gianni Posted September 16, 2019 Posted September 16, 2019 Hi @Mbee, from that example script, you should: copy all the #includes from the top and paste at the top of your script copy all from line 52 to the end of the script and paste the whole at the bottom of your script At this point you can call the _ArrayView() function from within your script to 'analyze' the passed Array lines 13 to 50 in that script ar only for testing and can should be removed having mixed the core of the function with the example code itself can actually create confusion. sorry P.S. since in this case your base array is 1D, in order to see if one of its elements contains another nested array, you can also simply use the _ArrayDisplay () function, even if you can't then 'browse' into it Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now