Explanation
FOR...NEXT Statement
Repeats a block of statements a specified number of times.Worth knowing
Useful and cross-version information about the programming environments of QBasic, QuickBasic and Visual Basic for DOS.
Useful and cross-version information about the programming environments of QBasic, QuickBasic and Visual Basic for DOS.
FOR counter = start TO end [STEP increment] [statementblock] NEXT [counter [,counter]...] |
counter | A numeric variable used as the loop counter. |
start and end | The initial and final values of the counter. |
increment | The amount the counter is changed each time through the loop. |
FOR i% = 1 TO 15
PRINT i%
NEXT i%
FOR i% = 7 to -6 STEP -3
PRINT i%
NEXT i%
See also: | DO LOOP | EXIT | WHILE WEND |