Hello,
Is there a way to stop or interrupt a looping thread without killing the script (ie without closing the .ahk file)?
Suppose you have a script which contains several threads (each with its own hotkey), and suppose one of the threads has a Loop, 99 command. Once you press the hotkey to begin running the looping thread, is there a way to designate another keystroke or mouse action which will stop or pause the looping thread but leave the script open?
Thanks
Stop looping thread without killing script Topic is solved
-
- Posts: 312
- Joined: 19 Nov 2013, 08:44
Stop looping thread without killing script
A ------------------------------ [A LOT OF SPACE] ------------------------------ LOT
"ALOT" is not a word. It never has been a word and it never will be a word.
"A LOT" is 2 words. Remember it as though there's [A LOT OF SPACE] between them.
"ALOT" is not a word. It never has been a word and it never will be a word.
"A LOT" is 2 words. Remember it as though there's [A LOT OF SPACE] between them.
Re: Stop looping thread without killing script Topic is solved
Exit
Code: Select all
1::
stop := false
Loop, 99
{
ToolTip, % "testing..." . A_Index
if (stop = true)
{
ToolTip
Exit
}
Sleep 1000
}
MsgBox, % A_ThisHotkey . " run completed."
return
2::stop := true
-
- Posts: 312
- Joined: 19 Nov 2013, 08:44
Re: Stop looping thread without killing script
Thanks Xtra,
What a great and clever solution!
That's just what I needed.
Thanks again.
What a great and clever solution!
That's just what I needed.
Thanks again.
A ------------------------------ [A LOT OF SPACE] ------------------------------ LOT
"ALOT" is not a word. It never has been a word and it never will be a word.
"A LOT" is 2 words. Remember it as though there's [A LOT OF SPACE] between them.
"ALOT" is not a word. It never has been a word and it never will be a word.
"A LOT" is 2 words. Remember it as though there's [A LOT OF SPACE] between them.
Who is online
Users browsing this forum: Bing [Bot], madensuyu1, Rohwedder, sachalamp and 137 guests