Jump to content

Call a function if your script breaks?


Recommended Posts

Search the Forum for "RunErrorsFatal" and "AutoIt.Error" if you are using COM.

There is no automatic way to dump the values of your variables into a file, you'd really have to do that manually as you go. Also search for "assert", some people have made some nifty assertion functions which could be adapted to that purpose.

The best thing you can do is develop with Scite, and pump messages into it's console.

Also, don't make assumptions about the state of your variables. For instance, if you run a function that is supposed to return an array of a specific size, before you go any further, test it by running it through IsArray, and make sure it's Ubound is what you expect. It takes longer, but it makes your code much more bulletproof.

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Link to comment
Share on other sites

Search the Forum for "RunErrorsFatal" and "AutoIt.Error" if you are using COM.

There is no automatic way to dump the values of your variables into a file, you'd really have to do that manually as you go. Also search for "assert", some people have made some nifty assertion functions which could be adapted to that purpose.

The best thing you can do is develop with Scite, and pump messages into it's console.

Also, don't make assumptions about the state of your variables. For instance, if you run a function that is supposed to return an array of a specific size, before you go any further, test it by running it through IsArray, and make sure it's Ubound is what you expect. It takes longer, but it makes your code much more bulletproof.

Heh thanks for that!

I do take many precautions to ensure the script runs properly, but it's already at 8K lines, and only about 2/3 done :/ Coupled with fat fingers, the script tends to break every so often.

Thanks again,

-Chad

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...