Closed chadwhitacre closed 3 years ago
Hi Chad, that's expected behaviour - in GW-BASIC every line must have a line number, including comments; if not, you'll get a Direct statement in file
error. Your program will work in QBASIC but not in GW-BASIC or PC-BASIC. For it to work you would have to write instead:
5 ' comment
10 PRINT "Greetings, program!"
Thanks @robhagemans. In that case, it's curious that this program seems to work:
10 PRINT "Greetings, program!"
' comment
Any explanation?
PC-BASIC 1.2 reads that in as the continuation of line 10 with an LF - note how LIST 10
will show both lines. This is no longer standard in 2.0 where you'll just get Direct statement in file
in this case, unless you set the --soft-linefeed
option on startup.
Note that that program actually leads to really weird behaviour in GW-BASIC where it continues to add keyboard input to the program listing. That's not something that makes much sense to try to reproduce, so the "correct" behaviour is basically undefined.
Steps
load"test"
Expected
Actual
Works
Doesn't Work
Notes
PC-BASIC version: 1.2.14 Operating system version: macOS 10.13.6 (17G10021)