[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In its argumentless form, repeatedly executes the remainder of the line on which FOR
was encountered until a QUIT
, GOTO
, or end-of-line is encountered, provided the optional postcondition evaluates to true or is omitted.
Syntax
FOR[:postcondition]
|
In its sentinel form, repeatedly executes the remainder of the line and sets a sentinel variable on each iteration, provided the optional postcondition evaluates to true or is omitted.
On the first iteration of the loop, glvn will be set to initalizer-expression. On each subsequent iteration, glvn will be incremented by increment-expression, and the loop will terminate when glvn meets or exceeds the value of max-expression.
Syntax
FOR[:postcondition] glvn=initializer-expression:increment-expression:max-expression
Example
USER> FOR I=1:1:10 WRITE I,! 1 2 3 4 5 6 7 8 9 10 USER> FOR I=2:2:10 WRITE I,! 2 4 6 8 10
In its explicit parameter form, a variable is set to each of a series of explicit values, once per iteration, provided the optional postcondition evaluates to true or is omitted. The loop terminates when no more values are available.
Syntax
FOR[:postcondition] glvn=expr1[,..exprN]
Example
USER> FOR I=60,"FOO",-3,"George",1450,$HOROLOG WRITE I,! 60 FOO -3 George 1450 66106,52388
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on September 20, 2023 using texi2html 5.0.