Jump to content

Hot Key Pause Question


Recommended Posts

  • Moderators

If your program is in the middle of a Function and you use the hotkey pause.

Will this pickup were is left off in the function or start it over?

I can tell which one mine is doing :think:

http://www.autoitscript.com/forum/index.ph...ndpost&p=177239

Run one of those examples, and you'll see with the tool tip when you pause it pauses at the number and restarts when you press pause again from that number.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

It would appear to pick up where it left off.

; Press Esc to terminate script, Pause/Break to "pause"

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")

While 1
    doStuff()
WEnd

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        SplashTextOn("Paused","Script is Paused", 200, 100)
    WEnd
    splashOff()
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func doStuff()
    For $i = 1 to 100
        Tooltip("Count = " & $i, 0, 0)
        Sleep(100)
    Next
EndFunc
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
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...