84
The
VIC 20
User
Guide
BASIC
Statements
The operation performed by a statement
is
specified using reserved
words (see Table 3-4).
Statements are not described in detail in this chapter. Refer to Appen-
dixes G and H for complete descriptions
of
all statements recognized by VIC
BASIC. This chapter introduces you to programming concepts, stressing
the way statements are used.
Remarks
It
is
appropriate that any discussion
of
BASIC statements begin by
describing the only BASIC statement which the computer will ignore: the
remark.
If
the first three characters of a BASIC statement are REM, the
computer ignores the statement entirely. So why include such a statement?
The answer
is
that remarks make your program easier to read.
If
you write a short program with five
or
ten statements, you will
probably have little trouble remembering what the program
does-unless
you leave it around for six months and then try to use it again.
If
you write a
longer program with
100
or
200
statements, you are quite likely to forget
something very important the very next time you use the program. After you
have written dozens of programs, you cannot possibly remember each one in
detail. The solution to this problem
is
to document your program by
including remarks that describe what the various parts
of
the program do.
Good programmers
use
plenty
of
remarks in all
of
their programs.
In
all
of this chapter's program examples
we
will include remarks
that
describe
what
is
going on, simply to get you into the habit
of
doing the same thing
yourself.
Remark statements have line numbers like any other statement. A
remark statement's line number can be used like any other statement's line
number.
Assignment
Statement
Assignment statements let you assign values to variables. You will
encounter assignment statements frequently in every type of BASIC pro-
gram. Here are some examples
of
assignment statements.