Sign in to follow this  
Followers 0
Guest colquhounb

Exit function and @error

3 posts in this topic

Quick question, i can not find the answer in the help, and I think it is simple...

I currently have a large .au3 file with many functions in it. I have a loop cycling through looking for particular events to happen, when they do, a particular function is launched.

If, while the user is being stepped through a function, @error =1 or someone hits cancel, I need to exit the function. I do not need autoit to close though.

I currently use

If @error =1 then Endfunc

but this is not good when upgrading to the latest version. What would be an alternative, keeping in mind I only want to exit one function, and keep autoit cycling happily waiting for the next event to occur?

Any help appreciated.... :whistle:

Share this post


Link to post
Share on other sites



You will have to test the @error within the function, then use Return.

If @error = 1 Then Return 0

Share this post


Link to post
Share on other sites

Bingo....thanks so much! :whistle:

Share this post


Link to post
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
Sign in to follow this  
Followers 0