Hello everyone,
I have a script with a loop that launches several subroutines, some with other subroutines with another loops inside, some launching other subroutines without loops.
I tried everything to stop the initial loop from launching them all at once.
I managed to stop the A_Index variable jumbling with a variable translation.
I tried to Use the Looping:= False command but it didn't work with all the loops inside the subroutines needing to run.
I could try a different loop for each subroutine but I guess I would still be with the same problem with different indexes launching the same subroutine instead of all types.
Is there a way to stop a specific loop then reactivate it?
Its all I need
Regards.
Stop a specific loop Topic is solved
Re: Stop a specific loop
It can be only 1 type (subroutine) per loop index. I could try breaking the loop After the gosub, and adding the index and calling the loop again at the end of the last subroutine called by the initial subroutine for all types .
Re: Stop a specific loop Topic is solved
Use SetTimer instead.
Code: Select all
#Persistent
Global Stop_f_loop := false
SetTimer f, -1
Return
F1::Stop_f_loop := true
F2::
Stop_f_loop := false
SetTimer f, -1
Return
f() {
static i := 0
MsgBox % ++i
If Not Stop_f_loop
SetTimer f, -1
}
Re: Stop a specific loop
Thanks for the reply!
Although that was not exactly what I wanted I can see that you have great knowledge of AHK. I have no idea what ( ) does for example.
I actually got it fixed by doing the break after calling the sub and the index add at the end of the sub before recalling the loop.
Only problem is that an if statement fails to evaluate a variable at the end of the sub. For example:
I keep getting the MsgBox with W...
It works well in another script
Isn´t that something?
Thanks and Regards!
Although that was not exactly what I wanted I can see that you have great knowledge of AHK. I have no idea what ( ) does for example.
I actually got it fixed by doing the break after calling the sub and the index add at the end of the sub before recalling the loop.
Only problem is that an if statement fails to evaluate a variable at the end of the sub. For example:
Code: Select all
If (Var = W) {
Var2:= 123
Var3:= 456
} Else {
MsgBox %Var%
}
It works well in another script
Isn´t that something?
Thanks and Regards!
Who is online
Users browsing this forum: NinjoOnline and 278 guests