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

QB45 Compatible SUB/FUNCTION #504

Open
SteveMcNeill opened this issue Jun 6, 2024 · 1 comment
Open

QB45 Compatible SUB/FUNCTION #504

SteveMcNeill opened this issue Jun 6, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@SteveMcNeill
Copy link
Member

In QB45, the following is perfectly acceptable (though not pretty):

PRINT "Hello"
SUB foo
    PRINT " World"
END SUB
foo

Subs and Functions can appear anywhere in the source, and compile with no issues. One didn't usually see this in QB45 as the IDE had a habit of removing SUB/FUNCTION and placing them at the end of the code, and which one interacted with in separate tabs using F2 (if my memory is correct on all that). If one wants to see this type of code in action, write the BAS file in some other editor (such as NotePad) and then just use QB45 to compile and run it from the command-line. It works 100%, with zero issues.

The most important bonus for SUB/FUNCTION working like this is:

  1. For library files. QB45 only uses single .BM library files. They don't have to be broken up into .BI for the top of the code and .BM for the bottom of the code. One $INCLUDE is enough to hold the whole library properly.
  2. This would be a good step forward to add in support for FN functionality, as FN would just basically be a local FUNCTION after this.
@SteveMcNeill SteveMcNeill added the enhancement New feature or request label Jun 6, 2024
@grymmjack
Copy link
Contributor

For library files. QB45 only uses single .BM library files. They don't have to be broken up into .BI for the top of the code and .BM for the bottom of the code. One $INCLUDE is enough to hold the whole library properly.

I would love this! It's a PITA to have to conditionally predict and include stuff in the existing archaic way.

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: Backlog
Development

No branches or pull requests

2 participants