Jump to content

Is it possible to Abort a function


Recommended Posts

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
Link to comment
Share on other sites

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