fgl_lastkey() returns an INTEGER code for the last key that was received by the runtime.
The code that the fgl_lastkey( ) function returns is the ASCII numeric code for the last keystroke before fgl_lastkey( ) was called. For example, if the last key that was pressed was the lowercase d, fgl_lastkey() returns 100. The value returned by fgl_lastkey() is not defined in a MENU statement.
You do not need to know the specific key codes to use fgl_lastkey(). fgl_keyval() can return a code to compare with the value returned by fgl_lastkey(). fgl_keyval( ) lets you compare the last key that the user pressed with a logical or physical key. For example, to check if the user pressed the Accept key, compare fgl_lastkey() with fgl_keyval("accept").
If you type something into a field that has an AUTONEXT attribute, and then invoke fgl_lastkey(), 4GL returns the code value of the last key that you pressed, regardless of any processing done in the AFTER FIELD or BEFORE FIELD clause.