Chapter Contents

Previous

Next
LASTKEY

LASTKEY



Returns the number of the last function key that was pressed from the application window

Category: Keys


Syntax
Details
Example
See Also

Syntax

keynum=LASTKEY();

keynum
contains the number of the function key that was pressed from the application window, or 0 if ENTER was pressed.

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

FKEYNAME

GETFKEY

SETFKEY

CONTROL


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.