|
| KiXtart 2001 Manual |
For Each
| Action: | Repeats a group of statements for each element in an array or collection. |
| Syntax: | FOR EACH $element IN group statements… NEXT FOR
EACH loops can be nested as many times as memory allows. |
| Parameters: |
Element
Group
|
| Remarks: | The
For Each block is entered if there is at least one element in group. Once
the loop has been entered, all the statements in the loop are executed for
the first element in group. As long as there are more elements in group,
the statements in the loop continue to execute for each element. When
there are no more elements in group, the loop is exited and execution
continues with the statement following the Next statement. |
| See Also: |
Do Until,
For Next, While Loop |
| Examples: |
Dim $MyArray[10] For Each $Element In $MyArray ? $Element Next $Root = GetObject( "LDAP://localhost" ) For Each $Obj in $Root ? $Obj.name Next |