As you know ObjectScript has neither FOREACH system command nor system function.
But it has a wide room for creativity.
The task is to loop over a global or local array and do something FOR EACH element.
There are 2 possible solutions:
- creating a macro that generates the required code sequences
- creating an Extended Command to perform the action. Both ways are presented here. The macro is a generic and quite flexible solution and easy to adapt if required.
##; ZFOREACHMACRO ; macro definitions
##; %key = variable provide to loop trough array
##; %arr = the gobal or local array to be looped
.png)
.png)