Original Author Paul Laughton, 2011
Page 37
De Re BASIC!
Text.open {r|w|a}, fn...
Indicate that either "r" or "w" or "a" must be chosen:
Text.open r, fn...
Text.open w, fn...
Text.open a, fn...
X, ...
Indicates a variable-sized list of items separated by commas. At least one item is required.
{,n} ...
Indicates an optional list with zero or more items separated by commas.
<statement>
Indicate an executable BASIC! statement. A <statement> is usually a line of code but may occur within
other commands such as: IF <lexp> THEN <statement>.
Optional Parameters
Many statements have optional parameters. If an optional parameter is omitted, the statement assumes
a default value or performs a default action.
If an optional parameter is omitted, use a comma to mark its place, so following parameters are handled
correctly. However, if there are no following parameters, omit the comma, too. With a few special
exceptions (like Print), no statement can end with a comma.
Numbers
You can type decimal numbers in a BASIC! program:
A leading sign ("+" or "-"), a decimal point ("." only), and an exponent (power of 10) are optional.
An exponent is "e" or "E" followed by a number. The number may have a sign but no decimal point.
If you use a decimal point, it MUST follow a digit. 0.15 is a valid number, but .15 is a syntax error.
Numbers in BASIC! are double-precision floating point (64-bit IEEE 754). This means:
A printed number will always have decimal point. For example, 99 will print as "99.0".You can print
numbers without decimal points by using the INT$() or FORMAT$() functions. For example, either
INT$(99) or FORMAT$("##", 99) will print "99".
A number with more than 7 significant digits will be printed in floating point format. For example,
the number 12345678 will be printed as 1.2345678E7. INT$() or FORMAT$() can be used to print
large numbers in other than floating point format.
Mathematical operations on decimal values are imprecise. If you are working with currency you
should multiply the number by 100 until you need to print it out. When you print it, divide by 100.