Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 29 additions & 27 deletions doc/Vintage_BASIC_Users_Guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
</head>
<body>
<h1>Vintage BASIC User's Guide 1.0.3</h1>
<p>� 2009&ndash;2017, <a href="mailto://lyle@vintage-basic.net">Lyle
<p>� 2009&ndash;2017, <a href="mailto:lyle@vintage-basic.net">Lyle
Kopnicky</a></p>
<p>Congratulations on installing Vintage BASIC! You are now the
proud owner of a copy of a versatile tool for BASIC development.</p>
<p>Vintage BASIC is a language derived from the Microsoft's
<p>Vintage BASIC is a language derived from Microsoft's
original <a href="http://en.wikipedia.org/wiki/Altair_BASIC">Altair
BASIC</a>.
It would feel right at home on a Commodore 64. The design tensions of
Expand All @@ -21,7 +21,7 @@ <h1>Vintage BASIC User's Guide 1.0.3</h1>
<li>Stick fairly close to the behavior of Microsoft BASIC v2 as
found on the&nbsp;Commodore 64.</li>
<li>Be informed by (but not always stick to) the ANSI Minimal
BASIC standard (ANSI X.360-1978).</li>
BASIC standard (ANSI X3.60-1978).</li>
<li>Relax constraints in the language where it is easy to do so
without compromising compatibility.</li>
</ul>
Expand Down Expand Up @@ -101,7 +101,7 @@ <h2><a class="mozTocH2" name="mozTocId153285"></a>BASIC
<p>Control flow will end when your program reaches the end of the
lines, when an <code>END</code> or <code>STOP</code>
statement is encountered, or when an error occurs. Errors may occur
during parsing or execution, and always being with an exclamation point
during parsing or execution, and always begin with an exclamation point
(<code>!</code>).</p>
<h2><a class="mozTocH2" name="mozTocId839205"></a>BASIC
Syntax</h2>
Expand Down Expand Up @@ -159,7 +159,7 @@ <h2><a class="mozTocH2" name="mozTocId116379"></a>BASIC
Precision depends upon your platform, but is generally IEEE bin32
(single precision). There are no special IEEE values, like +Inf or NaN.
String literals are enclosed in quotes, e.g. <code>"HELLO"</code>.
There are no escape sequences. To generate a quote character, append a <code>CHR$(34)</code>.</dd>
There are no escape sequences. To generate a quote character, use a <code>CHR$(34)</code>.</dd>
<dt><span style="font-style: italic;">varname</span></dt>
<dd>Variable names can include any number of letters followed
by any number
Expand All @@ -175,7 +175,7 @@ <h2><a class="mozTocH2" name="mozTocId116379"></a>BASIC
are considered the same.</dd>
<dd></dd>
<dd>Variables&nbsp;can store integers, floating-point
numbers or strings. Integer variables are mainly there to save storage
numbers, strings or user-defined functions. Integer variables are mainly there to save storage
memory; in calculations they are converted to floats. String variable
names are ended with a <code>$</code>, and integer
variables with a <code>%</code>, while floating-point
Expand All @@ -186,7 +186,7 @@ <h2><a class="mozTocH2" name="mozTocId116379"></a>BASIC
value in <code>A%</code> without a conflict.</dd>
<dt style="font-style: italic;">var</dt>
<dd>Variables can also be scalar or array. Scalar variables are
indicated by an variable name alone. Array variables are accessed by
indicated by a variable name alone. Array variables are accessed by
following the variable name with parentheses enclosing a
comma-separated list of expressions whose values are indices into the
array. For example, <code>A(3)</code> is the value from
Expand Down Expand Up @@ -214,7 +214,7 @@ <h2><a class="mozTocH2" name="mozTocId116379"></a>BASIC
keywords, so they cannot be used in variable names. See the list of
builtin functions below.</dd>
<dt><code>(</code><span style="font-style: italic;">expr</span><code>)</code></dt>
<dd>A parenthesized expression has the same value of
<dd>A parenthesized expression has the same value as the
expression. Parentheses can be used to override operator precedence.<code><span style="font-weight: bold;"></span></code></dd>
<dt><code><span style="font-weight: bold;"></span>-</code>
<span style="font-style: italic;">expr</span></dt>
Expand All @@ -236,22 +236,22 @@ <h2><a class="mozTocH2" name="mozTocId116379"></a>BASIC
value of the second expression. Division by zero is an error.</dd>
<dt><span style="font-style: italic;">expr1</span>
<code>+</code> <span style="font-style: italic;">expr2</span></dt>
<dd>Addition. Adds the value of the first expression to the
value of the second expression.<br>
<dd>Addition. For numbers, adds the value of the first expression to the
value of the second expression. For strings, concatenates two strings.<br>
</dd>
<dt><span style="font-style: italic;">expr1</span>
<code>-</code> <span style="font-style: italic;">expr2</span></dt>
<dd>Subtraction. Subtracts the value of the second expression
from the value of the first expression.</dd>
<dt><span style="font-style: italic;">expr1</span>
<code>=</code> <span style="font-style: italic;">expr2</span></dt>
<dd>Equality test. Evaluates to&nbsp;<code>0</code>
if the two strings or numbers are equal, <code>-1</code>
<dd>Equality test. Evaluates to&nbsp;<code>-1</code>
if the two strings or numbers are equal, <code>0</code>
if they differ.</dd>
<dt><span style="font-style: italic;">expr1</span>
<code>&lt;&gt;</code> <span style="font-style: italic;">expr2</span></dt>
<dd>Inequality test. Evaluates to <code>-1</code>
if the two strings or numbers are equal, <code>0</code> if
<dd>Inequality test. Evaluates to <code>0</code>
if the two strings or numbers are equal, <code>-1</code> if
they differ.</dd>
<dt><span style="font-style: italic;">expr1</span>
<code>&lt;</code> <span style="font-style: italic;">expr2</span></dt>
Expand All @@ -266,12 +266,12 @@ <h2><a class="mozTocH2" name="mozTocId116379"></a>BASIC
<dt><span style="font-style: italic;">expr1</span>
<code>&gt;</code> <span style="font-style: italic;">expr2</span></dt>
<dd>Greater than. Evaluates to <code>-1</code> if
the first string or number is less than the second, <code>0</code>
the first string or number is greater than the second, <code>0</code>
otherwise. (Strings are compared alphabetically.)</dd>
<dt><span style="font-style: italic;">expr1</span>&nbsp;<code>&gt;=</code>
<span style="font-style: italic;">expr2</span></dt>
<dd>Greater than or equal. Evaluates to <code>-1</code>
if the first string or number is less than or equal to the second, <code>0</code>
if the first string or number is greater than or equal to the second, <code>0</code>
otherwise. (Strings are compared alphabetically.)</dd>
<dt><code>NOT</code> <span style="font-style: italic;">expr</span></dt>
<dd>Negates a boolean expression. Specifically, nonzero values
Expand Down Expand Up @@ -376,7 +376,7 @@ <h3><a class="mozTocH3" name="mozTocId251348"></a>Builtin
</code><span style="font-style: italic;">float</span><code>)</code></dt>
<dd>In its first form, returns a substring starting from the
specified index (1-based), through the end of the string. In the second
form, returns a substring starting an index specified by the second
form, returns a substring starting at the index specified by the second
argument, with the number of characters specified by the third
argument. Indexes less than one or string lengths less than zero will
result in a runtime error. Any attempt to extract characters beyond the
Expand All @@ -389,7 +389,7 @@ <h3><a class="mozTocH3" name="mozTocId251348"></a>Builtin
error, while numbers too large will result in the whole string being
returned.</dd>
<dt><code>RND(</code><span style="font-style: italic;">float</span><code>)</code></dt>
<dd>Psuedorandom number generator. The behavior is different
<dd>Pseudorandom number generator. The behavior is different
depending on the value passed. If the value is positive, the result
will be a new random value between 0 and 1 (including 0 but not 1). If
the value is zero, the result will be a repeat of the last random
Expand All @@ -408,7 +408,7 @@ <h3><a class="mozTocH3" name="mozTocId251348"></a>Builtin
<dt><code>SQR(</code><span style="font-style: italic;">float</span><code>)</code></dt>
<dd>Returns the square root of the value. Argument must be
non-negative.</dd>
<dt><code>STR(</code><span style="font-style: italic;">float</span><code>)</code></dt>
<dt><code>STR$(</code><span style="font-style: italic;">float</span><code>)</code></dt>
<dd>Returns a string representation of the floating-point
value, as it would be printed by <code>PRINT</code>, but
without the trailing space.</dd>
Expand Down Expand Up @@ -453,7 +453,7 @@ <h2><a class="mozTocH2" name="mozTocId829004"></a>BASIC
variable names that may be used in the expression.
While the standard allows only for numeric functions of a single
floating-point variable, Vintage BASIC permits string, integer or
floating-point functions ofany number and type of arguments. Example: <code>DEF
floating-point functions of any number and type of arguments. Example: <code>DEF
FN F(X) = X^2 + 3*X - 4</code>. The argument variables shadow
the original variables; that is, the value of the original variable
with the same name will be restored after the function is evaluated.
Expand All @@ -467,7 +467,7 @@ <h2><a class="mozTocH2" name="mozTocId829004"></a>BASIC
literal values; they can be any expression. Attempting to re-dimension
an array will produce an error. Arrays can be referenced without
dimensioning; in that case they are automatically created as
one-dimenional arrays with an upper bound of 10. Example: <code>DIM
one-dimensional arrays with an upper bound of 10. Example: <code>DIM
RX$(20, 5)</code> creates a two-dimensional, 20x5 array of
strings.</dd>
<dt><code>END</code></dt>
Expand All @@ -486,7 +486,7 @@ <h2><a class="mozTocH2" name="mozTocId829004"></a>BASIC
value of the control variable has not exceeded the value
of&nbsp;the <span style="font-style: italic;">end</span>
expression, control will continue with the statement following the <code>FOR</code>.
But if the value of the control value exceeds <span style="font-style: italic;">end</span> (greater than
But if the value of the control variable exceeds <span style="font-style: italic;">end</span> (greater than
end if <span style="font-style: italic;">increment</span>
is positive, less than end if <span style="font-style: italic;">increment</span>
is negative), control will pass to the statement following the <code>NEXT</code>.
Expand Down Expand Up @@ -539,15 +539,15 @@ <h2><a class="mozTocH2" name="mozTocId829004"></a>BASIC
will be re-prompted. The user will also be re-prompted (with a double
question mark) if the user enters insufficient values to fill the
variables. The variables may be scalar or (indexed) array variables.
Examples: <code>INPUT "NAME AND AGE";NA$(I), AG(I)</code>.</dd>
Example: <code>INPUT "NAME AND AGE";NA$(I), AG(I)</code>.</dd>
<dt><code>LET</code> <span style="font-style: italic;">var</span> = <span style="font-style: italic;">expr</span></dt>
<dd>Evaluates the expression and assigns the value to the
variable. The <code>LET</code> keyword is optional.</dd>
<dt><code>NEXT</code> [<span style="font-style: italic;">var</span>]</dt>
<dd>Returns control to a <code>FOR</code>
statement to determine whether the loop should be repeated. If the
termination condition has not been met, control will proceed with the
line following the <code>FOR</code> statement. If the
statement following the <code>FOR</code> statement. If the
termination condition has been met, control will proceed with the
statement following the <code>NEXT</code>. How does the
interpreter determine which <code>FOR</code> goes with the
Expand Down Expand Up @@ -599,6 +599,8 @@ <h2><a class="mozTocH2" name="mozTocId829004"></a>BASIC
with a leading space, so that they take up the same amount of space as
negative numbers. Example: <code>PRINT "TURN";TU, "YOU
HAVE";LI;"LIVES LEFT"</code>.</dd>
<dt><code>?</code></dt>
<dd>An alias for <code>PRINT</code>.
<dt><code>RANDOMIZE</code></dt>
<dd>Re-seeds the random number generator used for the <code>RND</code>
function, based on the number of seconds that have elapsed since
Expand Down Expand Up @@ -638,9 +640,9 @@ <h2><a class="mozTocH2" name="mozTocId829004"></a>BASIC
statement was designed to send control to that solitary <code>END</code>
statement. Vintage BASIC imitates this behavior by treating the <code>STOP</code>
statement as an <code>END</code>. This is unlike Microsoft
version of BASIC, in which <code>STOP</code> is used to
BASIC, in which <code>STOP</code> is used to
terminate the program without clearing variables, so that they can be
inspected for debugging purpose, and the <code>CONT</code>
inspected for debugging purposes, and the <code>CONT</code>
statement can resume control where it left off. That wouldn't be very
useful in Vintage BASIC, since it does not have a read-eval-print loop.</dd>
</dl>
Expand Down Expand Up @@ -706,7 +708,7 @@ <h2><a class="mozTocH2" name="mozTocId193848"></a>Error
<dt><code>!REDIM'D ARRAY IN LINE </code><span style="font-style: italic;">label</span></dt>
<dd>A <code>DIM</code> statement was encountered,
but the array has already been dimensioned, either explicitly (through
anorther <code>DIM</code> statement), or automatically
another <code>DIM</code> statement), or automatically
(through reference to the array).</dd>
<dt><code>!RETURN WITHOUT GOSUB ERROR IN LINE </code><span style="font-style: italic;">label</span></dt>
<dd>A <code>RETURN</code> statement was
Expand Down