Commodore 64 User Manual page 130

Hide thumbs Also See for 64:
Table of Contents

Advertisement

GET is followed by a variable name, usually a string variable. If a
numeric variable was used and a nonnumeric key depressed, the pro-
gram would halt with an error message. The GET statement may be
placed into a loop, checking for any empty result. This loop will continue
until a key is hit.
10 GET A$: IF A$ ="" THEN 10
GET#
The GET# statement is used with a previously OPENed device or file,
to input one character at a time from that device or file.
GET #1,A$
This would input one character from a data file.
GOSUB
This statement is similar to GOTO, except the computer remembers
which program line it lost executed before the GOSUB. When a line with
a RETURN statement is encountered, the program jumps back to the
statement immediately following the GOSUB. This is useful if there is a
routine in your program that occurs in several parts of the program.
Instead of typing the routine over and over, execute GOSUBs each time
the routine is needed.
20 GOSUB 800
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
IF. . .THEN lets the computer analyze a situation and take two possi-
ble courses of action, depending on the outcome. If the expression is
true, the statement following THEN is executed. This may be any BASIC
statement.
If the expression is false, the program goes directly to the next line.
The expression being evaluated may be a variable or formula, in
which case it is considered true if nonzero, and false if zero. In most
cases, there is an expression involving relational operators
<=, >=, <>, AND, OR, NOT).
120
9

Hide quick links:

Advertisement

Table of Contents
loading

Related Products for Commodore 64

Table of Contents