Loops/Increment loop index within loop body: Difference between revisions
Content added Content deleted
(→{{header|M2000 Interpreter}}: now is ok for indexes above 39) |
m (→{{header|Wren}}: Library name change.) |
||
Line 4,174: | Line 4,174: | ||
=={{header|Wren}}== |
=={{header|Wren}}== |
||
{{libheader|fmt}} |
{{libheader|Wren-fmt}} |
||
Although it might appear as though one can change the index variable within a ''for'' loop, it does in fact change a local copy of the variable and the iteration is not affected at all. Consequently, the only way to complete this task in Wren is to use a ''while'' loop. |
Although it might appear as though one can change the index variable within a ''for'' loop, it does in fact change a local copy of the variable and the iteration is not affected at all. Consequently, the only way to complete this task in Wren is to use a ''while'' loop. |
||
<lang ecmascript>import "/fmt" for Fmt |
<lang ecmascript>import "/fmt" for Fmt |