breakintoprogram / agon-bbc-basic-adl

Official AGON QUARK Firmware: BASIC Interpreter (ADL version)
zlib License
15 stars 0 forks source link

Unexpected "No such variable at line ..." and "Syntax error at line ..." error messages when BASIC DATA statement has a colon character #15

Open tonedef71 opened 8 months ago

tonedef71 commented 8 months ago

When run, the following code results in a No such variable at line 110 error:

100 REPEAT
110   READ A%
120 UNTIL A% = 255
130 DATA 1:REM
140 DATA 255

If you remove the REM from line 130 and re-run the program, then the "Syntax error at line 110` error message gets displayed instead.

If you next remove the : character from line 130 and re-run the program, then the program completes successfully as expected.

If you next remove line 140 and re-run the program, then the expected "Out of DATA at line 110" error message is displayed.

Within a DATA statement with valid data, if the BBC BASIC interpreter should encounter an : character, then the colon and all text that appears after should be ignored like a comment, except when the colon is enclosed within double quotation marks, as that colon is embedded within a string of text which happens to be an entry of String DATA.

I previously reported this as an issue in the Agon BBC Basic repo; as expected, this issue exists in the 24-bit ADL version of Agon BBC BASIC as well.

breakintoprogram commented 8 months ago

Note: Check whether this is a quirk of BBC BASIC for Z80 first.

image

This looks like a quirk I've inherited from the original code.

NB: