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

INPUT prompt string should be optional #81

Open
udhos opened this issue Jan 19, 2019 · 3 comments
Open

INPUT prompt string should be optional #81

udhos opened this issue Jan 19, 2019 · 3 comments
Labels
fantasy Something that might be interesting. wontfix This will not be worked on

Comments

@udhos
Copy link

udhos commented Jan 19, 2019

I think INPUT without prompt string should be supported.

$ more input.bas
10 input a : print a
$ 
$ gobasic input.bas
Error running program:
	Line 10 : ERROR: INPUT should be : INPUT "prompt",var
$ 
@skx skx added the fantasy Something that might be interesting. label Jan 19, 2019
@skx
Copy link
Owner

skx commented Jan 19, 2019

All the versions of BASIC I'm familiar with expect a prompt. For example:

I think this is a matter of opinion, because you can receive the same result via:

 INPUT "", a

(Plus this avoids confusion if we were ever to allow multiple-inputs. e.g. "INPUT a, b" - does that mean read two input values? Or does it mean print the prompt from variable a, into variable b ?)

@skx skx added the wontfix This will not be worked on label Jan 19, 2019
@udhos
Copy link
Author

udhos commented Jan 19, 2019

In at least this BASIC dialect, the prompt string is optional:
http://www.antonis.de/qbebooks/gwbasman/input.html

Also, there are those old games using INPUT with no prompt string:
http://www.vintage-basic.net/bcg/mathdice.bas
520 INPUT T1

According to those games, "INPUT a, b" would mean to collect two numeric variables separated with comma:

10 input a,b: print a"-"b
  run
  ? 2,3
   2 - 3

@udhos
Copy link
Author

udhos commented Mar 6, 2019

Just for the records, it seems ZX Spectrum supported INPUT without prompt string:

100 REM this polite program remembers your name
110 INPUT n$
120 PRINT "Hello ";n$;"!"
130 GO TO 110

http://www.worldofspectrum.org/ZXBasicManual/zxmanchap2.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fantasy Something that might be interesting. wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants