58
The
VIC
20
User
Guide
or special features. However, having learned how to program your VIC in
BASIC, you
will
have little trouble learning any other computer's BASIC
dialect.
Some programming language syntax rules are obvious. The addition
and subtraction examples in Chapter 2 use obvious syntax. You do not have
to be a programmer to understand these simple calculation statements.
However, most syntax rules seem arbitrary, and sometimes they are.
For
example, why use
"*"
to represent multiplication? One would normally use
"X" for multiplication; but the computer would have no way
of
differentiat-
ing between the use
of
the "X" sign
to
represent mUltiplication or to
represent the letter
"x."
Therefore nearly all computer languages use the
asterisk
(*) to represent multiplication. Division
is
universally represented
by a slash
(j).
Since the standard division sign
(-:-)
is
not present on
computer
or
typewriter keyboards, some other character had to be selected.
The slash was probably chosen because it made the program expression
look like a fraction.
BASIC statement syntax deals separately with line numbers, data, and
instructions to the computer.
We
will
describe each in turn.
Line
Numbers
As
we
have already stated, in programmed mode every line
of
a BASIC
program must have a unique line number. The first line
ofthe
program must
have the smallest line number, while the last line must have the largest. In
between, line numbers must be in ascending order. The VIC computer forces
this upon you: no matter where you enter a line on the display, the VIC will
move it to its proper sequential position. Consider an existing program with
the following line numbers:
120
130
140
150
160
170
180
190
If
you enter a new statement with line number 165, the new statement
will initially appear below the existing program,
but
the computer will