This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:foreach [2020/04/21 19:13] admin |
en:foreach [2020/04/26 22:32] (current) admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== For Each / Next (Statement) ===== | ===== For Each / Next (Statement) ===== | ||
==== Format ==== | ==== Format ==== | ||
- | **for each** [[variables|variable]] **in** array \\ | + | **for each** [[variables|variable]] **in** |
+ | (tab)[[programsyntax|statement(s)]]\\ | ||
+ | **next** [[variables|variable]] | ||
+ | |||
+ | **for each** [[variables|key]] **in** [[Maps|map]] \\ | ||
+ | (tab)[[programsyntax|statement(s)]]\\ | ||
+ | **next** [[variables|variable]] | ||
+ | |||
+ | |||
+ | **for each** [[variables|key]] **%%-> | ||
(tab)[[programsyntax|statement(s)]]\\ | (tab)[[programsyntax|statement(s)]]\\ | ||
**next** [[variables|variable]] | **next** [[variables|variable]] | ||
Line 7: | Line 16: | ||
==== Description ==== | ==== Description ==== | ||
- | The FOREACH and NEXT commands are used to loop through the elementf of a 1 dimensional | + | The FOREACH and NEXT commands are used to loop through the elementf of a list, an array, or a maap. Each element will be returned in the variable. |
+ | |||
+ | If the array is two dimensional it will be traversed through the columns of row one then row two... | ||
==== Example ==== | ==== Example ==== |