qb45advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
KEY Statement Details
  QuickSCREEN      Details      Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
KEY Statement Details
 
Syntax                   Use
  KEY n, stringexpression      Assigns soft-key string values
  KEY LIST                     Displays soft-key string values
  KEY {ON|OFF}                 Turns on and off the soft-key display line
                               at the bottom of the screen
 
Assigning Strings to Function Keys
 
The placeholder n is a number representing the FUNCTION key. The
values for n are 1 to 10 for the FUNCTION keys, and 30 and 31 for
FUNCTION keys F11 and F12 on 101-key keyboards. The stringexpression
is a string of up to 15 characters that is returned when the function
key is pressed. If the stringexpression is longer than 15 characters,
the extra characters are ignored.
 
The KEY statement allows you to designate special "soft-key"
functions--strings that are returned when FUNCTION keys are pressed.
 
Assigning a null string to a soft key disables the FUNCTION key as
a soft key.
 
If the FUNCTION key number is not in the correct range, an error
message is displayed that reads "Illegal function call," and the
previous key string expression is retained.
 
Displaying Soft Key Assignments
 
You may display soft keys with the KEY ON, KEY OFF, and KEY LIST
statements:
 
  Statement   Action
  KEY ON      Displays the first six characters of the soft-key string
              values on the bottom line of the screen.
  KEY OFF     Erases the soft-key display from the bottom line, making
              that line available for program use. It does not disable
              the FUNCTION keys.
  KEY LIST    Displays all soft-key values on the screen, with all 15
              characters of each key displayed.
 
If a soft key is pressed, the effect is the same as if the user typed
the string associated with the soft key. INPUT$, INPUT,
and INKEY$ can all be used to read the string produced by pressing
the soft key.