Jump to content

Step through code?


Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...