Syntax
foreach <attribute-reference> {
[ statements ]
}
The foreach
statement loops over a list of attributes, as given by
<attribute-reference>
. The loop can be exited early by using the
break keyword.
Inside of the foreach
block, the attribute which is being looped
over can be referenced as "Foreach-Variable-". Where "" is the
depth of the loop, starting at "0". e.g. "Foreach-Variable-0". The
loops can be nested up to eight (8) deep, though this is not
recommended.
The attributes being looped over cannot be modified or deleted.
Example
foreach &Class {
update reply {
Reply-Message += "Contains %{Foreach-Variable-0}"
}
}