Commodore VIC-20 User Manual page 362

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

Advertisement

348
The VIC 20 User Guide
GETiI!
The GET External statement (GET#) receives single characters as input
from an external storage device identified via a logical file number.
Format:
GET#lf,var
The G ET# statement can only be used in program mode. G ET# fetches
a single character from an external device and assigns this character to
variable var. The external device is identified by logical file number
if.
This
logical file must have been previously opened by an OPEN statement.
GET# and GET statements handle variables and data input identically.
For details see the GET statement description.
Example:
10 GETi4.CI:
IF
C.-"" GOTO lEI
Get a keyboard character. Reexecute
if
no character is present
GOSUB
The GOSUB statement branches program execution to a specified line
and allows a return to the statement following GOSUB. The specified line is
a subroutine entry point.
Format:
GOSUB
In
The GOSUB statement calls a subroutine. The subroutine's entry point
must occur on line In. A subroutine's entry point is the beginning of the
subroutine in a programming sense; that is to say it is the line containing the
statement (or statements) that are executed first. The entry point need not
necessarily be the subroutine line with the smallest line number.
Upon completing execution the subroutine branches back to the line
following the GOSUB statement. The subroutine uses a RETURN state-
ment in order to branch back in this fashion.
A GOSUB statement may occur anywhere in a program; in conse-
quence a subroutine may be called from anywhere in the program.
Example:
100 OOSUB 2000
110 A=Bllle
Branch to subroutine at line 2000

Advertisement

Table of Contents
loading

Table of Contents