EasyManua.ls Logo

Commodore Plus 4 - Page 81

Commodore Plus 4
234 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...
Statement
name:
GETKEY
Format
GETKEY
variable
to
be
input
GETKEY
is
another
way
for
you
to
enter
data
while
the
program
is
being
RUN.
The
GETKEY
statement
accepts
only
one
key
at
a
time.
Whatever
key
is
pressed
is
assigned
to
the
string
variable
you
specified
in
the
GET
statement
(AS,
for
example).
GETKEY
is
useful
because
it
allows
you
to
enter
data
one
character
at
a
time
without
having
to
press
the
RETURN
key
after
each
character.
The
GETKEY
statement
may
only
be
used
in
a
program.
Example
of
GETKEY
in
a
program:
1000
PRINT
"PLEASE
CHOOSE
A,
B,
C,
D,
E,
OR
F"
1010
GETKEY
A$
Statement
Name
READ'DATA
Format:
READ
variables
to
be
input
DATA
data
items
to
be
read
The
READ/DATA
statements
are
used
as
a
convenient
way
to
assign
values
to
variables.
You can
think
of
the
READ
statement
as an
INPUT
statement
that
asks
the Plus/4
for
the
data,
rather
than
the
user
The
data
is
(naturally
enough)
kept
in
DATA
statements.
When
the
Plus/4
executes
a
READ
statement,
it
looks
at
the
next
data
item
in
the
DATA
statement,
and
assigns
it
to
the
variable
in
the
READ
statement.
The
READ
statement
is
always
used
with
a
DATA
statement.
A
DATA
statement
is
just
a
line
of
data
(words
or
numbers)
in
a
program.
The
READ
statement
is
used
to
assign
those
values
to
variables
(For
each
variable
listed
in
the
READ
statement,
your
Plus/4
"reads" a
value
from
the
DATA
line
for
that
variable.)
A DATA
statement
is
not
executable
and
can
appear
anywhere
in
the
program.
The
thing
to
remember
about
the
READ
statement
is
that
the
variable
type
must be
the
same
as
the
type
of
data
available
in
the
DATA
statement
(number
variables
for
numbers,
text
variables
for
text).
Otherwise,
a
TYPE
MISMATCH
_
ERROR
occurs.
Example.
10READA$.B$,C$,D$,E$
__
20
PRINT
A$:PRINT
B$:PRINT C$
30
PRINT
D$:
PRINT
E$

Other manuals for Commodore Plus 4

Related product manuals