PreviousNextIndex

LAST-EVENT system handle

A handle to the last event the application received.

Syntax

LAST-EVENT [ :attribute ] 

attribute
Attributes

Example

This procedure creates a variety of widgets and a frame that acts as a message area. As you move around the widgets the procedure tells you what events ABL generates.

r-lstevt.p
DEFINE VARIABLE msg_watcher  AS CHARACTER NO-UNDO FORMAT "x(50)". 
DEFINE VARIABLE fi           AS CHARACTER NO-UNDO FORMAT "x(50)" 
  LABEL "Fill-in". 
DEFINE VARIABLE edit         AS CHARACTER NO-UNDO 
  VIEW-AS EDITOR SIZE 10 BY 2. 
DEFINE VARIABLE txt0         AS CHARACTER NO-UNDO FORMAT "x(75)". 
DEFINE BUTTON exit LABEL "Go to Exit" AUTO-GO. 
DEFINE BUTTON test LABEL "Test" SIZE 15 BY 3. 
DISPLAY "Feel free to move around..." VIEW-AS TEXT SKIP  
  fi SKIP(0.1) 
  edit AT 2 SKIP(0.1) 
  test AT 10 exit AT 50 SKIP(0.5) 
  WITH FRAME f SIDE-LABELS. 
DISPLAY txt0 LABEL "LAST-EVENT:LABEL FUNCTION (TYPE) > SELF:TYPE LABEL" 
  WITH FRAME report 4 DOWN CENTERED TITLE "Messages". 
ON RETURN, TAB, ANY-PRINTABLE, GO ANYWHERE 
  RUN msgwatch. /* This procedure uses LAST-EVENT. */ 
    
ENABLE ALL WITH FRAME f. 
WAIT-FOR GO OF FRAME f FOCUS fi. 
PROCEDURE msgwatch. 
  txt0 = LAST-EVENT:LABEL + " " + LAST-EVENT:FUNCTION + " [" + 
         LAST-EVENT:EVENT-TYPE + "]-->" + SELF:TYPE + " " 
  txt0 = txt0 + (IF CAN-QUERY(SELF, "LABEL") THEN  
           SELF:LABEL ELSE STRING(SELF). 
  DISPLAY txt0 WITH FRAME report. 
  DOWN WITH FRAME report. 
END PROCEDURE. 

Notes
See also

LIST-EVENTS function, LIST-WIDGETS function, SELF system handle, VALID-EVENT function


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex