Sign in to follow this  
Followers 0
sublimnl

Is it possible to Abort a function

3 posts in this topic

#1 ·  Posted (edited)

I need to be able to abort a function if a button is pressed in my GUI. This function is basically a sleep(5000) command that allows the users time to abort the exit by pressing a button. I know I can test after the sleep(5000) line to see if the button was pressed, but I would really like something that will kill the function immediately and not sit there for a couple seconds before proceeding.

Any ideas?

Edited by sublimnl

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You have to set a flag and react on that in your function. Sleep is not so easy as you would know if you did create a small sample. Sleep suspends your process (thats not really the case with AutoIt but close enough). You have to create your own Sleep functionallity in your message loop.

EDIT: Provide some basic sample code for us to work with and Someone might give you a nice solution.

Edited by Uten

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