Previous Next

PROCESS EVENTS statement
Processes all outstanding events without blocking for user input.
Syntax 
 
PROCESS EVENTS
Example 
This procedure counts to 1,000 until you choose STOP:
 
DEFINE VARIABLE ix       AS INTEGER NO-UNDO.
DEFINE VARIABLE stop-sel AS LOGICAL NO-UNDO.
 
DEFINE BUTTON stop-it LABEL "STOP".
 
DISPLAY stop-it.
 
ON CHOOSE OF stop-it
  stop-sel = TRUE.
 
ENABLE stop-it.
 
DO ix = 1 TO 1000:  
  DISPLAY ix VIEW-AS TEXT.
  PROCESS EVENTS.
  IF stop-sel THEN LEAVE. 
END.
On each pass through the loop, the procedure displays the new value of ix and then checks whether any events are waiting to be processed. If no events have occurred, execution continues and the loop iterates. If the STOP button has been chosen, that event is processed changing the value of stop-sel. When execution continues, the program exits the loop.
If the loop does not contain the PROCESS EVENTS statement, the choose event never processes and the loop iterates until ix equals 1,000.
Notes 
*
*
*
*
*
In the context of the .NET blocking method, System.Windows.Forms.Application:Run( ), if you directly or indirectly execute the PROCESS EVENTS statement while displaying a non-modal ABL window, in certain contexts (such as within a user-defined function or non-VOID method) this statement execution raises the STOP condition. For more information on the .NET Application:Run( ), method, see the reference entry for the WAIT-FOR statement (.NET and ABL).
See also 
WAIT-FOR statement (ABL only), WAIT-FOR statement (.NET and ABL)

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.