Original Author Paul Laughton, 2011
Page 36
De Re BASIC!
PRINT "Hello, World!"
This program has one statement. The command is PRINT. It has one parameter, the string constant
"Hello, World!". (A string constant, or string literal, is a set of characters enclosed in double quotation
marks. This, too, will be explained later.)
If you start the BASIC! app, so you are in the Editor, you can type in this one-line program. Then you can
select Run from the Editor's menu. BASIC! will run your program. When the program is done running,
you see the Console, BASIC!'s, output screen, with Hello, World! printed at the top.
Command Description Syntax
Upper and Lower Case
Commands are described using both upper and lower case for ease of reading. BASIC! converts every
character (except those between double quotation marks) to lower case when the program is run.
<nexp>, <sexp> and <lexp>
These notations denote a numeric expression (<nexp>), a string expression (<sexp>), and a logical
expression (<lexp>). An expression can be a variable, a number, a quoted string or a full expression such
as (a*x^2 + bx + c).
<nvar>, <svar> and <lvar>
This notation is used when a variable, not an expression, must be used in the command. Arrays with
indices (such as n[1,2] or s$[3,4]) are considered to be the same as <nvar>, <svar> and <lvar>.
Array[] and Array$[]
This notation implies that an array name without indices must be used.
Array[{<start>,<length>}] and Array$[{<start>,<length>}]
In most contexts, numeric expressions inside the brackets are indices specifying a single array element.
In some commands, a pair of numeric expressions specifies a segment of the array. Both the start index
and length are numeric expressions, and both are optional. This notation is shorthand for:
Array [ { {<start_nexp>} {, <length_nexp>} } ]
Array$ [ { {<start_nexp>} {, <length_nexp>} } ]
{something}
Indicates something optional.
{ A | B |C }
This notation suggests that a choice of either A, B, or C, must be made. For example: