![]() Chapter Contents |
![]() Previous |
![]() Next |
| LASTKEY |
| Category: | Keys |
| Syntax | |
| Details | |
| Example | |
| See Also |
Syntax |
| keynum=LASTKEY(); |
Type: Numeric
| Details |
The returned value is the ordinal position of the key definition in the KEYS window. In order for this function to work, you must have a window variable or text in the DISPLAY window.
To retrieve the name of the last function key pressed by a user, use FKEYNAME.
LASTKEY is used in conjunction with CONTROL ENTER, ALWAYS, and ALLCMDS. LASTKEY does not retrieve the number of a function key that has a global command assigned to it.
| Example |
Return the number of the last function key that a user pressed. (This example requires a window with at least one window variable.)
INIT:
control enter;
return;
MAIN:
keynum=lastkey();
if (keynum ne 0) then
put 'Last function key is ' keynum;
else
put 'Last function key is not defined
or the ENTER key was pressed';
return;
| See Also |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.