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

BASIC programs saved as BAS which contain empty lines do not load properly into Agon BASIC. #47

Closed
tonedef71 opened this issue May 9, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@tonedef71
Copy link

tonedef71 commented May 9, 2023

A saved BASIC program listing which resembles the following ...

     5 :::::::::::::::
    10 : REM Hello W :
    15 :::::::::::::::
    20
    25 PRINT "Hello there, World!"
    30 GOTO 25

... will currently load into Agon BASIC as the following instead:

     5 :::::::::::::::
    10 : REM Hello W :
    15 :::::::::::::::

This gives the impression that when the LOADer encounters a blank line, such as in Line 20 above, the LOADer believes that the EOF has been reached.

Currently, such BASIC program listings could only be authored outside of Agon BASIC (such as in Nano or in the BBC BASIC IDE), since it is not possible within BBC BASIC to enter a line number without any keywords or tokens and press Enter without it being interpreted as manually deleting a line of BASIC code (whether it exists or not in the listing.

Interestingly, a BBC tokenized program with an empty line does LOAD into Agon BASIC without issue, which leads me to believe that support for BAS program listings with empty lines is merely a limitation of the text loading support of the LOAD command.

SIDE NOTE: If folks wish to be able to enter empty lines of code within Agon BASIC, then the BASIC/MOS editor would need to be enhanced to support the entry of empty line numbers, but it should only support that behavior when the line number does not already exist, otherwise support for manually deleting a line of BASIC code by entering its line number would be broken. An alternative way to support this behavior within Agon BASIC might be to enforce a definition that an empty line of BASIC is a line number followed by at least one space.

@oldpatientsea
Copy link

Note, you can use a statement separator : on its own to space out listings, eg:

     5 :::::::::::::::
    10 : REM Hello W :
    15 :::::::::::::::
    20 :
    25 PRINT "Hello there, World!"
    30 GOTO 25

The examples in the BBC BASIC (Z80) manual use this technique for empty lines but it doesn't explicitly recommend it as a convention for making a more readable listing. I can add a note to that effect.

@tonedef71
Copy link
Author

Note, you can use a statement separator : on its own to space out listings

Yep. Adding a single : is the most straightaway edit to make to such BASIC code to get it to LOAD properly with Agon BASIC, although it can be a bit tedious to do with nano when there are several blank lines in the code to be remedied.

@breakintoprogram breakintoprogram added the enhancement New feature or request label May 12, 2023
@breakintoprogram
Copy link
Owner

Fixed bug in ONEDIT1 - it would reset to command line (CLOOP) rather than returning if a line with only a line number was entered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Released
Development

No branches or pull requests

3 participants