Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppose for NEXT without variable #91

Open
udhos opened this issue Jan 25, 2019 · 1 comment
Open

Suppose for NEXT without variable #91

udhos opened this issue Jan 25, 2019 · 1 comment
Labels
enhancement New feature or request fantasy Something that might be interesting. wontfix This will not be worked on

Comments

@udhos
Copy link

udhos commented Jan 25, 2019

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
@skx
Copy link
Owner

skx commented Jan 25, 2019

Some BASICs allow this. e.g. visual-basic:

Some BASIC implementations do not.

  • e.g. ZX Spectrum

When I've been in doubt, I've gone with the latter approach.

@skx skx added enhancement New feature or request fantasy Something that might be interesting. wontfix This will not be worked on labels Jan 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fantasy Something that might be interesting. wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants