90
The
VIC
20
User
Guide
The statement on line
20
is
an
assignment statement; it assigns a value
to floating point variable
A.
The next statement
is
a GOTO; it specifies that
program execution must branch to line
100.
Therefore, the instruction
execution sequence surrounding this part
of
the program will be line
20,
then
line 30, then line
100.
Of course, some other statement should branch back to line 40. Other-
wise
the statement on line
40
would never be executed by program logic, as
illustrated above.
You can branch
to
any line number, even if the line has nothing but a
remark on it. However, the computer ignores the remark, so the effect
is
the
same as branching to the next line.
For
example, consider the following
branch:
20)A"4.37
(
~:
OOTO
70
60
~:>REM
THERE
IS
A
REMA~K,
AND
NOTHING
ELSE
ON
TH1S
LlNE
90
The program branches from line
30
to line
70.
There
is
nothing but a
remark on line 70, so the computer moves on to line 80, executing the
statements on this line. Even though you can branch to a remark, you might
as
well
branch to the next line. This may be illustrated as follows:
20)A=4.37
(
g
OOTO
EI0
70
REM
THE~E
IS
R
REMARK,
AND
NOTHING
ELSE
ON
THIS
LINE
80
90
COMPUTED
GOTO
STATEMENT
There
is
also a computed GOTO statement that lets program logic
branch to one of two or more different line numbers, depending on the
current value
of
a variable. Consider the following illustration: