PreviousNextIndex

KEYLABEL function

Evaluates a key code (such as 301) and returns a character string that is the predefined keyboard label for that key (such as F1).

Note: Does not apply to SpeedScript programming.
Syntax

KEYLABEL ( key-code ) 

key-code
Example

This procedure reads each keystroke the user makes, leaving the procedure only when the user presses GO. The KEYLABEL function tests the LASTKEY pressed, and returns the label of the key. (Remember that the value in LASTKEY is the key code of the last key pressed.)

r-keylbl.p
DISPLAY "Press the " + KBLABEL("GO") + " key to leave procedure" 
  FORMAT "x(50)". 
REPEAT: 
  READKEY. 
  HIDE MESSAGE. 
  IF LASTKEY = KEYCODE(KBLABEL("GO")) THEN RETURN. 
  MESSAGE "Sorry, you pressed the"  KEYLABEL(LASTKEY) "key.". 
END. 

Note

Some key codes can be associated with more than one key label. The KEYLABEL function always returns the label listed first in the ABL table of key labels.

See also

KEYCODE function, KEYFUNCTION function


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex