Eagle117 Posted May 14, 2007 Posted May 14, 2007 I'm completely new to AutoIt but I wrote a script to automate opening some windows and do some file processing that I needed at work and now I'm a hero! One thing that I found annoying was that when something went wrong and it stopped doing what I expected, I couldn't find a way to see where in the script it was. Is there a way to step through the code or at least to see what line it hung on so I can debug it? I searched around in Help but didn't find anything.
erebus Posted May 14, 2007 Posted May 14, 2007 Try by adding MsgBox(es) in your code so as to know each time which part is being executed. I.e.: ; code here MsgBox(0,"","ok this is finished") ; more code here MsgBox(0,"","ok with this too") ; and so on... Of course there are more elegant ways to debug your code but this is a fast and dirty example which is easy to remember.
Eagle117 Posted May 14, 2007 Author Posted May 14, 2007 That is what I've been doing but normally I'm ripping through a list of 500-1000 entries and it takes nearly 15 minutes to complete what I need it to do. It is normally the last or second to last entry that it hangs on so I wouldn't want to answer that box every single time. I've been playing around in the forum search and it appears that there isn't really the step feature that I'm looking for. Maybe I can use the dbg command or something.
herewasplato Posted May 15, 2007 Posted May 15, 2007 ...a list of 500-1000 entries...Add AutoItSetOption ("TrayIconDebug", 1) to the top of your script and then mouse over the AutoIt icon whenever your script hangs. [size="1"][font="Arial"].[u].[/u][/font][/size]
herewasplato Posted May 15, 2007 Posted May 15, 2007 (edited) Thank you. That will help a lot.You are welcome. Enjoy AutoIt.Edit: ...and a belated welcome to the forum... Edited May 15, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size]
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