EasyManua.ls Logo

Apple IIe - Page 104

Apple IIe
320 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...
104
Apple
lie
Users
Handbook
GET
ii
Applesoft
tJ
Integer
The
GET
statement
inputs
a single character
from
the
keyboard.
The character
is
not
displayed
on
the
screen.
Configuration
GET
variable
variable
can be any legal
Applesoft
variable.
Although
variable can ' be any variable,
it
is
to
the
user's
advantage
to
use a string variable and
convert
it
to
a
numeric
variable
with
the
VAL
function.
If
a
numeric
variable was used
with
GET,
any
non-numeric
character
entered
will
cause a syntax
error
and halt
program
execution.
10 PRINT
"PRESS
A KEY";
20
GET
A$
30
PRINT
Example
40
PRINT "THE
KEY
PRESSED
WAS";A$
50
PRINT
60
PRINT "IF
THE
KEY
PRESSED
WAS
NOT
A DISPLAYABLE
CHARACTER IT
WOULD
NOT
BE
DISPLAYED"
70
END
In
the
preceding
example,
line
10
prompts
the
user
to
press a
key. Line
20
waits
for
a key
to
be pressed.
When
a key
is
pressed,
the
character value
of
the
key
is
assigned
to
the
variable
A$. Line
40
then
displays
the
character
input.
Line
60
is
included
because
some keys
generate
characters
that
cannot
be displayed (i.e.
I
return
key,
ESC
key and
the
space
bar).
~

Other manuals for Apple IIe

Related product manuals