Jdop Posted February 5, 2008 Share Posted February 5, 2008 I have a program that is randomly getting this error (it loads data from a webpage). It works 99% of the time, but someting is triggering the array bounds error. I would be glad to try and debug this, or intercept the error before it crashed the script, but this error message is not helpful and it appears to be internal to autoit (not in any of the includes) , so I cant insert debug code where the error originates. Any ideas? Link to comment Share on other sites More sharing options...
Mast3rpyr0 Posted February 5, 2008 Share Posted February 5, 2008 try using a msgbox() to see what some of your variables are. check the variable that is incrementing the array subscript and the size of the array. My UDF's : _INetUpdateCheck() My Programs : GameLauncher vAlpha, InfoCrypt, WindowDesigner, ScreenCap, DailyRemindersPick3GeneratorBackupUtility! Other : Bored? Click Here! Link to comment Share on other sites More sharing options...
martin Posted February 5, 2008 Share Posted February 5, 2008 I have a program that is randomly getting this error (it loads data from a webpage). It works 99% of the time, but someting is triggering the array bounds error. I would be glad to try and debug this, or intercept the error before it crashed the script, but this error message is not helpful and it appears to be internal to autoit (not in any of the includes) , so I cant insert debug code where the error originates. Any ideas?Apart from what Mast3rpyrO has already said, before you use the variable check that it is an array with IsArray, and when you increment the index make sure you don't go beyond Ubound($Array).You can insert debug code where the error occurs, or before it, I think you are misunderstanding something there. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Jdop Posted February 5, 2008 Author Share Posted February 5, 2008 Apart from what Mast3rpyrO has already said, before you use the variable check that it is an array with IsArray, and when you increment the index make sure you don't go beyond Ubound($Array).You can insert debug code where the error occurs, or before it, I think you are misunderstanding something there. No , I understand. The problem I 'm referring to is the fact that the error message gives no indication of any kind WHERE in my code the problem is. I have array functions in a number of places. Yes, I could put debug code in every possible spot, but that's rather inelegant. Is there some reason AI cant report the line number or calling routine in the error message? I am running compiled code most of the time fyi. Link to comment Share on other sites More sharing options...
Siao Posted February 5, 2008 Share Posted February 5, 2008 (edited) I am running compiled code most of the time fyi. And that is why the line is reported as -1. Edited February 5, 2008 by Siao "be smart, drink your wine" Link to comment Share on other sites More sharing options...
Squirrely1 Posted February 5, 2008 Share Posted February 5, 2008 (edited) @Jdop - You do know about the @Compiled macro, don't you? You could use it like this in your script: If @Compiled Then ... Else ... EndIf Debugging some things about a script, you need a compiled version of it, but not as soon in the development process as you do when you don't use the @Compiled macro. Edited February 5, 2008 by Squirrely1 Das Häschen benutzt Radar Link to comment Share on other sites More sharing options...
Jdop Posted February 6, 2008 Author Share Posted February 6, 2008 I ran the same code from source, and was able to reproduce the error and get a line number. The 'rare' nature of the problem made it tricky to catch. I imagine it would be possible for AutoIt to output a more informative error message from the compiled version, but possibly at a cost of bloating the code, I don't know. If there isn't an option to compile with line numbers, maybe there should be. 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