Re: Is there an undocumented get_key or similar ?
Posted in 1995
The fgl_lastkey() and fgl_keyval() functions which everyone is mentioning were added in Version 4.10 of 4GL. Since the original poster mentioned that he is on 4.0, the only thing available to him is the undocumented/unsupported/ replaced-by-fgl_lastkey() feature called eflastkey. Here is some information: There is a global variable called eflastkey which is set in effin.c which holds the value of the last key typed. eflastkey is a short integer which will contain the ascii value of 'regular' keys typed and special values for keys for which 4GL does a 'mapping'. The ACCEPT KEY, for example is defined as 2016, LEFT arrow is defined as 2002 and RIGHT arrow is defined as 2003. If your linker accepts multiple global definitions of the same variable (treating one as the primary declaration and all others as extern) then you can simply include the variable eflastkey in the globals section of your 4GL program: GLOBALS DEFINE eflastkey SMALLINT END GLOBALS Then, during your INPUT statement, you can test the value: CASE eflastkey WHEN 2000 # UP ARROW WHEN 2001 # DOWN ARROW WHEN 2002 # LEFT ARROW WHEN 2003 # RIGHT ARROW OTHERWISE # Some other key END CASE If your linker gives you a problem with the definition of eflastkey, you can always call a C function such as CALL lastkey from your INPUT statement as: lastkey() { extern short eflastkey; switch (eflastkey) { case 2000: ... case 2001: ... case 2002: ... case 2003: ... default: ... } } You can test for other special mapped values such as INTERRUPT KEY which will set eflastkey to 2011 (assuming it has been DEFERed of course). This information might be in InformixLink, but I'm not sure. June ---- June Tong Informix Software ---- ---- junet@informix.com On-Site Regency Support at SAP ---- ---- Informix: (415)926-6140 SAP: (415)286-6808 ----