Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
BASIC09
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Program organization=== A key difference between BASIC09 and conventional BASICs of the era, like the canonical [[Microsoft BASIC]], is the addition of the <code>PROCEDURE</code> structure which created separately executable blocks of code. Code in a <code>PROCEDURE</code> had more in common with complete programs in other BASICs, including the variables being [[local variable|local]] to the code, and their ability to be executed in a stand-alone fashion. <code>PROCEDURE</code>s were called by name using the <code>RUN</code> command, and could include variables for function-call semantics; for instance, <code>RUN add(4,7)</code> calls a procedure named <code>add</code> that takes two parameters. Parameters were imported into the procedure using the <code>PARAM</code> keyword, in this example <code>PARAM a,b</code>:{{sfn|Manual|1984|p=5.1}} PROCEDURE add PARAM a,b PRINT a+b A side-effect of the use of named procedures is that the resulting memory workspace is, in effect, its own namespace. In this respect, the BASIC09 system appears to the user to be a directory of callable programs. This contrasts with typical BASICs, where only one program is available at a given time and the construction of larger programs calling library-like code generally requires the [[source code]] to be copied and pasted between separate programs. In BASIC09, the user can <code>LOAD</code> procedures by name into the workspace and then call them from their own code to construct larger programs from the separately stored procedures.{{sfn|Manual|1984|p=3.5}}{{efn|The [[GRASS (programming language)|GRASS]] system was similar in that its BASIC-like language could be assembled from separate named procedures, but did so by leaving everything as untokenized source code, as opposed to pre-compiling as in BASIC09.}} In addition to code in the workspace, if the program invokes <code>RUN</code> with a procedure name that could not be found, it would then look for a disk file with the same name and load and run that file. This worked not only with BASIC09 code, but also any other executable program, including [[machine language]] files. This meant that BASIC09 could easily call system routines.{{sfn|Manual|1984|p=9.12}} In addition to <code>RUN</code>, other common BASIC commands likewise used names. For instance, <code>LIST bob</code> would print out the source code ("list") the procedure named "bob", while <code>LIST*</code> prints out all of the procedures currently in memory. The prettyprinted output from <code>LIST</code> could be redirected to a file or a printer with a shell-like notation, e.g. <code>LIST bob >/p</code>. One could also <code>SAVE</code> and <code>LOAD</code> procedures from storage.{{sfn|Manual|1984|p=2.9}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)