Loop List Action Icon

Loop List Action

Declaration

<AMLOOPLIST LIST="list" VARNAME="text" DELIMITER="text">
  (block of steps to loop)
</AMLOOP>

See Also

Loop, Loop Files, Loop Windows, Loop Processes, Loop Expression, Loop Dataset, Break, End Loop

Description

Loops through items in a list (comma, carriage return, or other delimited text). With each successive loop a block of steps is executed and the current index variable is updated with the next item in the list. The loop ends when at the end of the list or when a Break is encountered.

Practical Usage

To loop a block of steps through the records (rows) in a list (which is a variable containing multiple rows of data). With each loop the current record (row) in the list is incremented, until the last row is reached at which point the loop is ended.

Parameters

General Tab

List
Text, Required
MARKUP: List="Steve,Jeff,Scott"

Specifies a list of data to Loop through. The List can be delimited by a variety of characters.

Variable Name
Number, Optional Default - 0
MARKUP: VARNAME="VARNAME"

Specifies the record (row) to start on when moving through the dataset.

Delimiter
Text, Optional - Default - Comma
MARKUP: DELIMITER="comma"

Specifies the character that delimits the items in the list.

The Available Options are:

comma: The delimiter is a comma (e.g. item1,item2,item3).

new_line: The delimiter is a new line.

semi_colon: The delimiter is a semi colon (e.g. item1;item2;item3).

space: The delimiter is a space (e.g. item1 item2 item3).

(custom): The delimiter is another character as specified (simply use the character).

Notes

Standard Error Handling Options
This action also includes the standard "Error Causes" and "On Error" failure handling options/tabs

More on Error Handling Options

Variables and Expressions
All text fields allow the use of expressions by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, a popup expression builder is available in all these fields by pressing F2.
More on variables...

More on expressions...

More on the expression builder...

Examples

<AMVARIABLE NAME="CURRENTITEM">
<AMCREATEVAR VARNAME="MYLIST" VARVALUE="SteveGeorgeScottJeff" VARDESC="">
<AMLOOPLIST LIST="%MYLIST%" VARNAME="currentitem" DELIMITER="new_line">
  <AMMESSAGEBOX MESSAGETEXT="%CURRENTITEM%">
</AMLOOP>