Loop - End Loop
Declaration
</AMLOOP>
Description: Marks the end of a block of steps that is to be looped by any of the Loop actions.
Practical Usage
Used with any loop step to mark the end of the block of steps to be looped during runtime. Note that by default, when any loop activity is added to the Steps pane of the Task Builder, it is automatically followed by an End Loop activity. This option can be disabled in the Editor options of the Task Builder.
General Parameters
This activity contains no parameters.
Example
The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.
The Loop activity used to loop a total of 5 times. A Message Box is contained inside the Loop/End Loop block to display the sequencing of each iteration.
<AMVARIABLE NAME="theCounter"> </AMVARIABLE> <AMLOOP TOTALLOOPS="5" RESULTVARIABLE="theCounter"> <AMMESSAGEBOX>This is iteration number %theCounter%. </AMMESSAGEBOX> </AMLOOP>
The Loop activity used to loop through a range with the starting index set to 1 and the ending index set to 10. The number by which the index is increased by is set to 3. A Message Box is contained in the body of the loop to display the current index during each iteration.
<AMVARIABLE NAME="theCounter"></AMVARIABLE> <AMLOOP FROM="1" TO="10" STEP="3" RESULTVARIABLE="theCounter"> <AMMESSAGEBOX>This is index %theCounter%.</AMMESSAGEBOX> </AMLOOP>