SuperBASIC
# SuperBASIC

SuperBASIC is an advanced variant of the BASIC programming language with many structured programming additions. It was developed at Sinclair Research by Jan Jones during the early 1980s.

Originally SuperBASIC was intended as the BASIC interpreter for a home computer code-named SuperSpectrum, then under development. This project was later cancelled; however, SuperBASIC was subsequently included in the ROM firmware of the Sinclair QL microcomputer (announced in January 1984), also serving as the command line interpreter for the QL's QDOS operating system.

It was one of the first second-generation BASICs to be integrated into a microcomputer's operating system (unlike BBC BASIC which preceded it in 1981), making the OS user-extendable—as done by Linus Torvalds in his formative years.

## Advanced features

* RESPR for resident procedures, e.g. to extend QDOS
* choice of parameters passed to procedures
* procedures return parameters as chosen
* IF - THEN - ELSE - END IF
* FOR - NEXT - EXIT - END FOR
* REPeat - NEXT - EXIT - END REPeat
* SELect ON - ON - REMAINDER - END SELect
* arbitrarily RETurn from within procedures & functions
* data type coercion between numeric and string variables
* actual parameters passing data type to formal parameters
* array operations: slicing, joining etc.
* LOCal arrays & (string) variables
* AUTOmatic line numbering
* relative RESTORE & DATA

The function below illustrates the last eight of these features. After having RUN it, entering

will print FRI to the screen. Until cleared (e.g. by entering NEW), the function Iso will act like an extension to the operating system. Similarly, according to the QL User Guide, "many of the operating system commands are themselves defined as procedures."

## Example

ctrl+space

