| Directives |
|
| Format | NEXT
[var] Where:
|
|||
| *Note* | Refer to FOR ..NEXT Loop While Incrementing, for complete syntax. | |||
| Description | When
ProvideX encounters the NEXT directive,
the current variable is incremented or decremented by the
STEP value and, if the current value
does not exceed the ending value, control is returned to
the directive following the FOR. The variable you use in the NEXT directive must match that of the currently active FOR. If no FOR is active or the variables do not match, ProvideX returns an Error #28: No corresponding FOR for NEXT. The control variable can be omitted from the NEXT directive because the increment/decrement of the FOR var is assumed automatically. However, the NEXT var is useful for readability purposes, especially if it appears within a nested loop structure. |
|||
| See Also | FOR ..NEXT Loop While Incrementing | |||
| Example | 0010
FOR I=1 TO 10 0020 PRINT I, 0030 NEXT ! NEXT I, since I is current -:RUN 1 2 3 4 5 6 7 8 9 10 |
|||