For each
Syntax:
For each <Variable name 1> In <Variable name 2> Do
// Operators
[Break;]
// Operators
[Continue;]
// Operators
EndDo;
Parameters:
<Variable name 1>
The variable that is assigned the next collection element value on each iteration. The variable value can also be changed inside the loop.
In
The range identifier for the <Variable name 2> parameter.
<Variable name 2>
The variable or expression that represents a collection. Elements from this collection are assigned to <Variable name 1>.
Do
The operators following the Do keyword are executed for each collection element.
// Operators
An operator or a sequence of operators to be executed.
Break
Breaks the loop execution at any point. Then the control is passed to the operator following the EndDo keyword.
Continue
Passes the control to the beginning of the loop where the loop conditions are calculated and evaluated. The operators following the Continue operator are skipped in this iteration.
EndDo
A keyword that denotes the end of the loop operator structure.
Description:
The loop operator For Each is intended for iterating through collection values. On each iteration, a new collection element is processed. The iterating process ends when all of the collection values are processed.