Consultor Eletrônico



Kbase P121234: 4GL/ABL: How to trap for the F4 button when there is an ALERT-BOX has focus in character application
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   02/01/2009
Status: Verified

GOAL:

4GL/ABL: How to trap for the F4 button when there is an ALERT-BOX has focus in character applications?

GOAL:

Is it possible to trap for the F4 event while an ALERT-BOX has focus in TTY applications?

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.x
OpenEdge 10.x

FIX:

Yes, it is possible to trap the F4 button in a character TTY application by implementing code to check the LOGICAL of a MESSAGE statement. For example:
MESSAGE "Press Yes, No or F4"
VIEW-AS ALERT-BOX QUESTION BUTTONS YES-NO
TITLE "" UPDATE choice AS LOGICAL.
IF choice = ? THEN
/* The F4 processing goes here */ .
ELSE
IF choice THEN
/* The YES processing goes here */.
ELSE
/* The NO processing goes here */.
Alternatively, a CASE statement may be used to implement the same logic as above:
MESSAGE "Press Yes, No or F4"
VIEW-AS ALERT-BOX QUESTION BUTTONS YES-NO
TITLE "" UPDATE choice AS LOGICAL.
CASE Choice:
WHEN TRUE THEN /* Yes */
DO:
/* The YES processing goes here */
END.
WHEN FALSE THEN /* No */
DO:
/* The NO processing goes here */.
END.
OTHERWISE
DO:
/* The F4 processing goes here */
END.
END CASE.
Optionally the KEYFUNCTION and LASTKEY functions may also be used in a variation of the above code sample.