Used with a previously QPENed device or file
to
input
one character at
a lime. Otherwise, it works like the GET statement
This command
can only be executed within
a
program.
EXAMPLE:
GET*1,A$
GOSUB
GOSUB
line
#
This statement is like the GOTO statement,
except that
your
Commodore 1
6
remembers
where It came from When a
line
with
a
RETURN statement is encountered, the program
Jumps back to the
statement immediately following
the GOSUB The target of
a GOSUB
statement is called
a
subroutine
A
subroutine is useful
it there is
a
routine In your program that can
be used by
several different
portions of
the program
Instead of duplicating
the
section of program
over and
over,
you can set it up as a subroutine, and GOSUB to it from
the
different parts of
the
program
See also the RETURN statement.
EXAMPLE
20 GOSUB 800
means
go to
the subroutine
beginning
al
line
BOO
and
execute
800 PRINT
"HI
THERE";RETURN
GOTO or GO TO
GOTO line
#
After
a GOTO statement is executed, the next line to be executed wiil
be the one with
the
line number following
the word GOTO. When used
120
1
(
I
(
I
I
f
1
r
.
i
i
1
(
f
i
i
f
(
i
i
in direct
mode.
GOTO line # allows you to start
execution of the
program
at the
given line number witnout clearing the variables
EXAMPLE:
10 PRINT
"REPETITION IS THE MOTHER OF LEARNING"
20 GOTO 10
The GOTO in line
20 causes
line 10
to
be run continuously, until the
key
is pressed
GRAPHIC
GRAPHIC mode
[.clear
option]
This statement puts your
Commodore 16 in one of lis
5
graphic modes
mode description
normal text
1 high-resolution graphics
2 high-resolution graphics,
spilt
screen
3
multicolour
graphics
4
multicolour graphics, split screen
When
executed.
GRAPHIC 1
-
4 allocates
a
10K bit-mapped area, and
the BASIC text area is moved down below ihe hwes area, This area
remains allocated even if the user returns to TEXT mode (GRAPHIC 0).
It 1
is
given in the GRAPHIC
statement
as the second
argument,
the
screen is also cleared
EXAMPLES:
GRAPHIC 1,1
GRAPHIC 4,0
Selects hhres graphic mode and clears the
screen.
Selects
multi-colour graphics with an area lor text,
without
clearing
the
screen
121