The Foreach command executes nested commands for each element of the specified object variable.

Variable Name
Specify a variable name. This variable must be an object of an array or an associative array (map) type. Nested commands will be executed for each of its elements.

Variable Item
Specify the name of the variable into which the next element will be written. This variable will also be an object.

Variable Index
You can specify a variable name to get the index of the item. For arrays it is counted from 0, for associative arrays, the corresponding key will be written to the variable.

Download sample script

The result of the script

Online Demo
Downloads Documentation Scripts