Commands & Syntax > Commands > Macro Flow Control >

www.perfectkeyboard.com

 

Repeat steps BREAK - < for_break > ... [Pro]

 

Repeat steps BREAK
<for_break>
Available in: Professional edition

This command breaks a "for" loop execution and cause that the macro continues execution after "for_end" command of the broken "for" loop. See also "for" command.

 

 

Example (Macro Steps):

 

1

<#> <#> This macro shows how to use "for" loop.

2

<#> <#> There are two embedded "for" loops.

3

<#> <#>

4

Macro execution: ONLY COMMANDS

5

Repeat steps UNTIL "vX < 5" (Counter variable initial value = "vX=1", Counter loop increment = "1")

6

Repeat steps UNTIL "vY < 50" (Counter variable initial value = "vY=1", Counter loop increment = "1")

7

Message SHOW "Information" : "Counters [x,y] = [%vX%,%vY%] Press 'F10' to break the y-loop." (other parameters: x = -100, y = -100, Window title = For Counters, Buttons = None, Timeout (seconds) = 0, Always on top = ).

8

Error message DISABLED

9

WAIT FOR Object = "KEY", Event = "PRESS", Parameter = "", Timeout (seconds) = "1", Exact = "0"

10

Error CLEAR

11

Error message ENABLED

12

If KEY / MOUSE BUTTON "" is "Down" then execute following steps

13

Repeat steps BREAK

14

ENDIF

15

Repeat steps END

16

Repeat steps END

Example (Plain Text):

 

<#> This macro shows how to use "for" loop.

<#> There are two embedded "for" loops.

<#>

<cmds>

 

<for>("vX=1","vX < 5","1")

 

<for>("vY=1","vY < 50","1")

 

<msg>(-100,-100,"Counters [x,y] = [%vX%,%vY%]

 

Press 'F10' to break the y-loop.","For Counters",0,0,0)

 

<me_error_nodisplay> <waitfor>("KEY","PRESS","<F10>",1,0)<me_error_clear><me_error_display>

 

<if_key>("<F10>","DOWN")

   <for_break>

<endif>

 

<for_end>

 

<for_end>