Kbase 13397: TRYING TO capture GO or F2 - ON LEAVE OF FILL-IN - use U1
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
TRYING TO capture GO or F2 - ON LEAVE OF FILL-IN - use U1
If a user is trying to override the F2 GO function when leaving a
fill-in, here is how do to it. The following code sample traps the
F2 key only in the first field in the frame. "U1" is a "Developer
Event" -- refer to Appendix C in the Language Reference manual for
further information on Developer Events.
DEF VAR a AS CHAR.
DEF VAR b AS CHAR.
FORM a b WITH FRAME x.
ON "U1" OF a IN FRAME x DO:
MESSAGE "pressed F2" VIEW-AS ALERT-BOX.
END.
ON LEAVE OF a IN FRAME x DO:
IF LAST-EVENT:LABEL = "F2" THEN DO:
APPLY "U1" TO a IN FRAME x.
RETURN NO-APPLY.
END.
MESSAGE "leave" VIEW-AS ALERT-BOX.
END.
ENABLE ALL WITH FRAME x.
WAIT-FOR "GO" OF FRAME x.
Progress Software Technical Support Note # 13397