Commodore VIC-20 User Manual page 133

Hide thumbs Also See for VIC-20:
Table of Contents

Advertisement

GET*
Used with a previously OPENed device or file to input one charcter at
a time,
EXAMPLE:
GET#1,A$
GOSLJB
This statement is like the GOTO statement, except that the VfC
remembers where it came from. When a line with a RETURN state
ment is encountered, the program jumps back to the statement im
mediately following the GOSUB. This is useful if there is a routine in
your program that occurs several times in different parts of the pro
gram. Instead of typing the same over and over, you type it once and
GOSUB to it from the different parts of the program. 20 GOSUB 800
means go to the subroutine beginning at line 800 and execute it.
GOTO or GO TO
When a statement with the GOTO command is reached, the next line
to be executed will be the one with the line number following the word
GOTO,
IF...THEN
The IF...THEN statement lets your VIC analyze a situation and take
two possible courses of action depending on the outcome. If the ex
pression being evaluated is found to be true, the statement following
the word THEN is executed. This may be a line number, which will
cause The VIC to GOTO That line of the program* It may also be any
other BASIC statement or statements. If the expression is false, then
the next line [not the next statement on the same line) is execuTed
instead.
The expression being evaluated may be a variable or formula, in which
case it is considered true if non-zero, and false if zero. In most cases,
there is an expression involving the relational operators (=,,, =, = ,
,AND,OR,NOT). If the result is found to be true, it has a value of — 1,
and a value of 0 if false. See the section on relational operators for an
explanation of how this works.
123

Advertisement

Table of Contents
loading

Table of Contents