Open udhos opened 5 years ago
gobasic should support NEXT without a variable.
The NEXT variable should be optional unless for BASIC code collapsing multiple FOR loops into the same NEXT (10 for a=1 to 2: for b=3 to 5: next b,a).
Documentation: https://hwiegman.home.xs4all.nl/gw-man/FORNEXT.html
$ gobasic next.bas 1Error running program: Line 30 : Expected IDENT after NEXT in FOR loop, got Token{Type:NEWLINE Value:\n} $ $ more next.bas 10 for i=1 to 3 20 print i 30 next
Some BASICs allow this. e.g. visual-basic:
Some BASIC implementations do not.
When I've been in doubt, I've gone with the latter approach.
gobasic should support NEXT without a variable.
The NEXT variable should be optional unless for BASIC code collapsing multiple FOR loops into the same NEXT (10 for a=1 to 2: for b=3 to 5: next b,a).
Documentation: https://hwiegman.home.xs4all.nl/gw-man/FORNEXT.html