EasyManua.ls Logo

Commodore VIC-20 - GOTO; IF-THEN

Commodore VIC-20
404 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Appendix
G:
BASIC
Statements 349
Subroutine branches back here
2000
Subroutine entry point
2098
RETURN
Branch back to line
110
GOTO
The GOTO statement branches unconditionally to a specified line.
Format:
GOTOln
Example:
19
GOTO
10e
Executed in immediate mode, GOTO branches to the specified line in
the stored program without clearing the current variable values. GOTO
cannot reference immediate mode statements, since they do not have line
numbers.
IF·THEN
The IF-THEN statement provides conditional execution of statements
based on a relational expression.
Format:
IF
condition THEN statement[:statement ... ] Conditionally execute statement(s)
IF
condition
{THEN}
line Conditionally branch
GOTO
If
the specified condition is true, then the statement or statements
following the
THEN
are executed.
If
the specified condition
is
false, control
passes to the statement(s) on the next line and the statement
or
statements
following the THEN are not executed.
For
a conditional branch, the branch
line number
is
placed after the word
THEN
or
after the word GOTO. The
compound form
THEN
GOTO
is
also acceptable.
IF
A = I THEN
50
}
IF
A = 1 GOTO
50
Equivalent
IF
A = I THEN GOTO
50

Other manuals for Commodore VIC-20

Related product manuals