Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 3085

8-bit acorn software: other • Re: BBC BASIC and Functions

$
0
0
The other thing to remember is that END can be anywhere in a BBC BASIC program, not just the last line, and there can be multiple ENDs, or none, as BBC BASIC doesn't require a program to be terminated with an END keyword (unlike Atom BASIC for instance).

Functions and procedures should be stored in the program where they are not likely to be visited by the interpreter whilst running through the program, ie. the interpreter shouldn't encounter a DEF keyword while RUNning, only PROC or FN. This is why functions and procedures are usually stored towards the latter part of a program after an END, or sometimes where the program sets up a "forever" loop, after an UNTIL0, etc.

The first line could be an END if the program is entirely made up of functions and procedures you might want to use in immediate mode. I do this occasionally; once the program is RUN, it ends immediately but has set up BASIC for knowing where the functions and procedures are so they can be called from the BASIC prompt.

Statistics: Posted by BeebMaster — Fri Mar 22, 2024 4:17 pm



Viewing all articles
Browse latest Browse all 3085

Trending Articles