inexorabletash / jsbasic

Applesoft BASIC in JavaScript

Home Page:https://calormen.com/jsbasic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with PRINT CHR$(I);

wjsteele opened this issue · comments

If you type in:

5 FOR I = 0 TO 255
10 PRINT CHR$(I)
15 NEXT I

The code works perfectly, but if you change line 10 to:

10 PRINT CHR$(I);

Notice the additional ; at the end.

You get an error stating "Invalid option in line 10." However, if you limit the loop to 5 to 255, it works just fine again.

Smaller repro:

10 PRINT CHR$(4);CHR$(5)

On a real Apple (under ProDOS) both the original repro and this minimal one give SYNTAX ERROR - the CHR$(4) is invoking the DOS hook, and the command parser doesn't know what to do with CHR$(5) as a DOS command.

Fixed to fail with Syntax Error. Thanks for the report!