lowbattery Posted August 24, 2023 Share Posted August 24, 2023 Some of my end users might occasionally get the dreaded "subscript used on non-accessible variable" message with a line number that's only relevant to the compiled version. Usually debugging this is therefore a nightmare for me. Is there an easier solution to debug this issue? Obviously it's things that SciTE's Syntax Check doesn't catch. Link to comment Share on other sites More sharing options...
Andreik Posted August 24, 2023 Share Posted August 24, 2023 SciTE can't catch runtime errors. It looks like you are accessing an array with an index out of bound. Without seeing any code from you I would say to check your arrays bounds before accessing them by indices to be sure you are in the limits. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
lowbattery Posted August 24, 2023 Author Share Posted August 24, 2023 5 minutes ago, Andreik said: SciTE can't catch runtime errors. It looks like you are accessing an array with an index out of bound. Without seeing any code from you I would say to check your arrays bounds before accessing them by indices to be sure you are in the limits. Yeah, that's what's happening. But at 13,000 lines, and lots of Redim, it can get tricky. Oh well. I figured there might be something easier. Link to comment Share on other sites More sharing options...
Developers Jos Posted August 24, 2023 Developers Share Posted August 24, 2023 One can get the line that the error is about by running au3stripper with the mergeonly option. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Nine Posted August 24, 2023 Share Posted August 24, 2023 If this happens only occasionally, here how I debug it. You will need to create a log of all the functions that use arrays. Once you know which functions are involved, add all details of array usage in the log. You should be able to discover every single array implied in a bug. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
lowbattery Posted August 24, 2023 Author Share Posted August 24, 2023 2 minutes ago, Nine said: If this happens only occasionally, here how I debug it. You will need to create a log of all the functions that use arrays. Once you know which functions are involved, add all details of array usage in the log. You should be able to discover every single array implied in a bug. That's good advice! Thanks. Link to comment Share on other sites More sharing options...
lowbattery Posted August 24, 2023 Author Share Posted August 24, 2023 (edited) 16 minutes ago, Jos said: One can get the line that the error is about by running au3stripper with the mergeonly option. Forgive my ignorance, but how do I run au3stripper. I tried in the past, but the docs point to a directory inside SciTE that doesn't exist. I also tried adding #Au3Stripper_Parameters=/MergeOnly to the top of my Au3 and compiled it but that didn't seem to do anything either. I truly have looked into it but gave up after about an hour and haven't tried again until now. Edit: Nevermind. It seems that your bio link has a link to the portable version which has au3stripper. For waterer reason the SciTE that comes with AutoIt install lacks it. Edited August 24, 2023 by lowbattery Link to comment Share on other sites More sharing options...
Developers Jos Posted August 24, 2023 Developers Share Posted August 24, 2023 First install the separate scite4autoit3 installer which comes with these extra utilities. lowbattery 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
argumentum Posted August 24, 2023 Share Posted August 24, 2023 (edited) On 8/24/2023 at 1:44 PM, lowbattery said: my end users might occasionally get the dreaded "subscript used on non-accessible variable" message use something to look professional while you learn to code Edited January 16 by argumentum oops. posted the wrong link =/ Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Sly01 Posted January 10 Share Posted January 10 @Jos I'm currently facing a similar Situation. I've ran Au3Stripper the only thing it does is removing my comments and empty lines... I don't see the rest of the code.. So my code goes from 700 to 500 lines ... But I need 9390 am I missing something? Link to comment Share on other sites More sharing options...
Developers Jos Posted January 10 Developers Share Posted January 10 1 hour ago, Sly01 said: am I missing something? Yes... the /MO or /MergOnly option is missing when you get that: #Au3Stripper_Parameters=/mergeonly SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Sly01 Posted January 10 Share Posted January 10 Thanks Jos, I'll give it a shot Link to comment Share on other sites More sharing options...
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