Commands & Syntax > Commands > Macro Flow Control >

www.perfectkeyboard.com

 

Loop BEGIN - < begloop >() ... [Pro]

 

Loop BEGIN
<begloop>(Repeat)
Available in: Professional edition

Macro loop feature allows to repeat several times a part of macro (macro steps) that are enclosed between "begin loop" and "end loop" commands.

 

#

Parameter name

Parameter description

1

Repeat

The number of repeats. Can be one of these options:
Repeat > 0 - The Repeat is the actual number of loops to be performed.
Repeat = 0 - The user specifies the number of repeats in the runtime.
Repeat = -1 - The user is asked each loop to continue or stop repeating.

 

Example (Macro Steps):

 

1

<#> <#> This example shows how to use loop commands

2

Macro execution: ONLY COMMANDS

3

Variable SET "vNum=", Message text="How many Notepads you want to open ?"

4

Loop BEGIN Repeat = vNum

5

Run APPLICATION "notepad.exe" (other parameters: Parameters = , Folder path = , Window state = Normal). Macro execution waits for application to finish up to "0" seconds.

6

Loop END

Example (Plain Text):

 

<#> This example shows how to use loop commands

<#>

<cmds>

<varset>("vNum=","How many Notepads you want to open ?")

<begloop>(vNum)

   <execappex>("notepad.exe","","",0,0)

<endloop>