Flow-control structures: Difference between revisions

Content added Content deleted
m (→‎call: added another "see also" thingy. -- ~~~~)
m (→‎{{header|REXX}}: clarified the "leave" and "iterate" statements (where located). -- ~~~~)
Line 1,715: Line 1,715:


===iterate===
===iterate===
The '''iterate''' statement immediately transfer control to the   '''do'''   statement, that is, it (may) iterates (increments or decrements) the named REXX variable (if any) that is specified on the   '''do'''   statement.   The '''iterate''' statement can also specify which   '''do'''   loop is to be iterated if there is a named variable on the '''do''' loop.
The '''iterate''' statement immediately transfer control to the innermost active   '''do'''   statement in which the '''iterate''' statement is located, that is, it (may) iterates (increments or decrements) the named REXX variable (if any) that is specified on the   '''do'''   statement.   The '''iterate''' statement can also specify which   '''do'''   loop is to be iterated if there is a named variable on the '''do''' loop.


(All indentations in REXX are merely cosmetic and are used for readability.}
(All indentations in REXX are merely cosmetic and are used for readability.}
Line 1,738: Line 1,738:


===leave===
===leave===
The '''leave''' statement transfer control to the next REXX statement following the   '''end'''   statment of the current   '''do'''   loop.   The '''leave''' statement can also specify which '''do''' loop is to be left if the '''do''' loop has a named variable.
The '''leave''' statement transfer control to the next REXX statement following the   '''end''' &nbsp statment of the current (active)   '''do'''   loop in which the '''leave''' statement is located.   The '''leave''' statement can also specify which '''do''' loop is to be left (terminated) if the '''do''' loop has a named variable.
<lang rexx> do j=1 to 10
<lang rexx> do j=1 to 10
say 'j=' j
say 'j=' j