Jump to content

Recommended Posts

Posted

Is it possible to skip a loop level with a hotkey? for example..

HotKeySet("^-", "Skipstep")

for $i = 0 to 30

    Sleep(3000)
    MsgBox(0, "test $i...", $i)
    
Next

Func Skipstep()
    ContinueLoop
EndFunc

I know that that code won't work, but it gives you an idea of what I'm trying to do. Possible, or...?

Posted

Is it possible to skip a loop level with a hotkey? for example..

HotKeySet("^-", "Skipstep")

for $i = 0 to 30

    Sleep(3000)
    MsgBox(0, "test $i...", $i)
    
Next

Func Skipstep()
    ContinueLoop
EndFunc

I know that that code won't work, but it gives you an idea of what I'm trying to do. Possible, or...?

HotKeySet("^-", "Skipstep")
Global $skipit = False

For $i = 0 To 30
    Sleep(3000)
    MsgBox(0, "test $i...", $i)
    If $skipit Then ExitLoop
    
Next
$skipit = False; must remember to set it back in case there is another loop which we don't want to quit too soon.

Func Skipstep()
    $skipit = True
EndFun
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Posted

HotKeySet("^-", "Skipstep")
Global $skipit = False

For $i = 0 To 30
    Sleep(3000)
    MsgBox(0, "test $i...", $i)
    If $skipit Then ExitLoop
    
Next
$skipit = False; must remember to set it back in case there is another loop which we don't want to quit too soon.

Func Skipstep()
    $skipit = True
EndFun
Well the problem with that would be that it would quit the loop, whereas I want it to continue, but on the next iteration. It gives me an idea though, since I could just do something like:

HotKeySet("^-", "Skipstep")
Global $skipit = False

For $i = 0 To 30
    Sleep(3000)
    If $skipit Then ContinueLoop
    MsgBox(0, "test $i...", $i)
    
$skipit = False; must remember to set it back in case there is another loop which we don't want to quit too soon.
Next

Func Skipstep()
    $skipit = True
EndFun

That would do what i need. Thanks for the help!

Posted

Well the problem with that would be that it would quit the loop, whereas I want it to continue, but on the next iteration. It gives me an idea though, since I could just do something like:

HotKeySet("^-", "Skipstep")
Global $skipit = False

For $i = 0 To 30
    Sleep(3000)
    If $skipit Then ContinueLoop
    MsgBox(0, "test $i...", $i)
    
$skipit = False; must remember to set it back in case there is another loop which we don't want to quit too soon.
Next

Func Skipstep()
    $skipit = True
EndFun

That would do what i need. Thanks for the help!

Ah I see I misunderstood.

I think your change will do the same as what I wrote because once $skipit is true it won't get set back to false because the line which sets it false is skipped over by the continueloop.

Try this

For $i = 0 To 30

Sleep(3000)

If $skipit Then

$skipit = False

ContinueLoop

EndIf

MsgBox(0, "test $i...", $i)

Nexte]

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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
×
×
  • Create New...