Unexpected NEXT
Amstrad CPC
Severity: MinorWhat it means
Error 1 in Amstrad's list: a NEXT command has been encountered while not in a FOR loop, or the control variable in the NEXT command does not match that in the FOR.
Affected Models
- Amstrad CPC464
- CPC664 and CPC6128 (Locomotive BASIC 1.1)
How to Fix It
-
LIST the program and pair each NEXT with its FOR.
The inner loop closes first: FOR i ... FOR j ... NEXT j ... NEXT i.
-
Check the variable after each NEXT against its FOR.