Chapter
10
I
BASIC
Keywords
KEY/Set/Display Statement
KEY
number,string
KEY
ON
KEY
OFF
KEY
LIST
KEY
number,string
Assigns or displays function key values.
Number
is an integer in the range
1
to
12 that indicates the
function key being defined
(m
-[I.
String
is the string expression assigned
to
the key and may con-
tain a maximum
of
15 characters.
You can program the function keys on your computer to generate
a specific string
of
characters. When you press the key, BASIC
displays the string on the screen just
as
if you had typed every
character. Initially, the function keys have these values:
F1 LIST F7 TRONm
F2 RUN= F8 TROFF-
F3 LOADā F9 KEY
F4 SAVEā F1O SCREEN 0,0,0
[ENTERI
F5 CONT- F11 none
F6 ,āLPTl:ām F12 none
Function keys
11
and 12 do not have initial values. You can use
the KEY statement to define these keys. You also can use the
KEY statement
to
redefine the other function keys
so
that
BASIC displays the strings you use most often.
You can remove the string from a function key by assigning it a
string length
of
zero
(ā ā).
For example:
KEY
1
,
āāI
Key no longer has
a
string assigned to it. Moreover, assign-
ing
a
null string (length zero)
to
a function key disables it as a
soft key. If the
soft
key is disabled, INKEY$ returns a 2-byte
string. See Appendix D
for
more information.
190