Acorn Computers BBC Micro Model B w/8271 — Acorn BBC Micro Model B w/8271 User Guide Manual PDF

273 NEXT Purpose This is used in conjunction with FOR to make the computer loop around a set of statements a number of times. If the loop is opened with (for example) FOR speed=10 TO 100 then the NEXT statement would normally be in the form NEXT speed but the word speed is optional. Example 340 length=100 350 FOR X=0 TO 640 STEP 2 360 Y=2*length+250 370 DRAW X,Y 380 NEXT A statement delimiting FOR...NEXT loops. The control variable ( X in the last example) is optional. Description If a variable is given after NEXT then the computer will ‘pop’ other FOR...NEXT loops off the ‘stack’ until it finds a matching variable. If none is found, an error will be reported. Syntax NEXT [ ] , [ ] , ...

Associated keywords FOR , TO , STEP