EasyManua.ls Logo

Commodore Plus 4 - Page 55

Commodore Plus 4
464 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...
BASIC
Version
3.5
Commands,
Functions,
and System
Variables
43
GETKEY
abbr.
gEkE
GETKEY
input
list
Like
INPUT,
GETKEY
accepts
input
from
the
keyboard
during
program
execution.
GETKEY,
however,
accepts
only
a
single
key
at
a
time
as
data
entry.
Unlike
GET,
GETKEY
waits
for
input.
Parameter:
variable(s)
The
variable
is
nearly
always
a
string
variable.
It
stands
for
the
key
to
be
typed
in
response
to
the
GETKEY
command.
Use
of
a
numeric
variable
allows
only
the
0
through
9
keys
to
be
entered.
Any
other
key
causes
a
type
mismatch
error,
which
aborts
the
program
unless
TRAPped.
Example:
10
?
"PRESS
THE
CURSOR
KEY
TO
ANSWER"
SO
?
"MY
GROUP
IS:
<-
RED OR
BLUE
->"
30
GETKEY
A$
40
IF
A$
=
CHR$(157)
THEN
?
"RED
GROUP,
DO
ODD-NUMBERED
EXERCISES"
50
IF
A$
=
CHR$(29)
THEN
?
"BLUE
GROUP,
DO
EVEN-NUMBERED
EXERCISES"
GET#
GET#
file
number,
input
list
Waits
for
you
to
press
a
key;
the
key's
value
is
assigned
to
A$.
Checks
key
entered.
CHR$(157)
is
cursor-
left
key
code.
Check
key
entered.
CHR$(29)
is
cursor-
right
key
code.
Abbr.
gE#
Retrieves
data
one
character
at
a
time
from
an
OPENed
device
or
file.
GET#
works
like
a
GET
command
except
that
the
GET
command
gets
a
character
from
the
keyboard,
while
the
GET#
command
gets
a
character
from
a
device
or
a
file.
GET#
works
like
INPUT#
except
that
INPUT#
gets
a
whole
group
of
characters
from
the
file,
while
GET#
gets
only
one
character
at
a
time.
Parameters:
file
number,
variable(s)
1.
The
file
number
is
a
logical
file
number
that
links
the
file
or
device
to
other
commands,
including
the
OPEN
command
that accesses
the
device
or
file
before
it
can
be
used.
2.
The
variable
is
nearly
always
a
string
variable.
Use
of
numeric
variables
allows
only
values
from
ASC("0")
(48)
to
ASC("9")
(57)
to
be
read.
Anything
else
causes
a
type
mismatch
error,
which
aborts
the
program
unless
TRAPped.

Other manuals for Commodore Plus 4

Related product manuals