The foreach statement allows iteration over a list of words, often specified by wildcarding. Each time through the loop, the control variable name is given the value of the next word in the list.
The for statement offers the more conventional numeric iteration. Multiple iteration ranges, separated by commas, can be specified on the for statement.
The while statement iterates so long as expr continues to evaluate as true.
The repeat statement has two variations. The first provides for the iteration of a single statement an integer number of times. The second form iterates until expr evaluates as true.
Statement relationships
Expression operators
Wildcard characters
Tutorial: foreach, for, while and repeat
Tutorial: Programming constructs
Tutorial: Expressions
Tutorial: Wildcarding