INKEY$
INKEY$
IS
a function which returns a
Single
character Input from either
the
specified
Or
default channel.
An optional timeout
can
be specified which
can
walt
for
a specified lime before returning,
can return
Immediately or
can
walt
for
ever
If
no
parameter
IS
specified
then
INKEY$
will
return
immediately.
•
INPUT allows data
to
be entered
Into
a SuperBASIC program directly from the OL
keyboard by
the
user.
SuperBASIC halts the program
until
the
specified amount
of
data
has been input;
the
program
will
then continue. Each
item
of data must be terminated
by
the
ENTER
key.
INPUT
will
input data from either the specified or
the
default channel.
If
input
is
required
from
a particular console channel
the
cursor
for
the
window connected
to
that channel
will
appear and start
to
flash.
INPUT
syntax:
example:
syntax:
INKEY$ [[(channel)
I(channel, time)
I(time)]
where: time 1
..
32767 [wait
for
specified number
of
frames]
time
~
-1 [wait foreverj
time
~
0 [return Immediately]
i.
PRINT INKEY$ [input
from
the
default channel]
il.
PRINT INKEY$(#4) [input
from
channel
4j
iiI.
PRINT INKEY$(5OJ Iwait
for
50 frames
then
return
anyway]
IV.
PRINT INKEY$(Q) Ireturn immediatly
(poll
the
keyboard)]
v.
PR
I
NT
IN
KEY$
(#3,100)
[walt
for
100
frames
for
an
input from
channel 3
then
return
anyway]
separator:
~
I
TO
prompt:= [channel,] expression separator
INPUT [prompt] [channel] variable *I,variable] *
•
•
28
example:
ii.
iii.
INPUT
("Last
guess
"&
guess
& "New
guess?")
!
guess
INPUT
"What
;s
your
guess?";
guess
100
INPUT
"array
size?"
!
Limit
110
DIM
array(limit-1)
120
FOR
eLement = 0
to
Limit-1
130 INPUT
("data
for
eLement"
&
element)
I
array(eLement)
140
END
FOR
element
150 PRINT
array
12/84
•