TOTALLOOPS="number" FROM="number" TO="number"
Loops through a range of numbers. The variable specified in the Index parameter is updated with the current loop count. With each successive loop a block of steps are executed and the loop counter is incremented by the number specified in the Step parameter. The loop ends after the counter has reached the number specified in the stop parameter or when a Break is encountered.
Commonly used to loop a block of steps through a range of numbers or loop a certain number of times.
Specifies the number of loops to be performed. Specifying TOTALLOOPS=5 is the same as specifying FROM=1 and TO=5
Specifies the number to start counting from when determining the number of times to loop. This value will be reflected in the index value returned as well.
Specifies the number to count up to when determining the number of times to loop.
The number by which the index is incremented by when looping through the FROM= and TO= parameters. For example, if FROM=1 and TO=10 and STEP=2 then the action would loop 5 times, if STEP=1 then it would loop 10 times.
Species the name of a variable to populate with the current counter value. This number starts at FROM= and is incremented by STEP= each loop, until TO= is reached.
This action includes the Description tab for entering a custom step description.
More on setting custom step description
This action also includes the standard Error Causes and On Error failure handling options/tabs.
More on Error Handling Options
All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.
More on variables
More on expressions
More on the expression builder
NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.
This task simply creates ten separate folders in a particular directory, sequentially numbering each folder from 1 to 10.
<AMLOOP FROM="1" TO="10" RESULTVARIABLE="theCounter">
<AMCREATEFOLDER FOLDER="C:\Temp\Folder%theCounter%" />