Progress
Language Reference


PROCESS EVENTS Statement

Interfaces
OS
SpeedScript
All
All
No

Processes all outstanding events without blocking for user input.

SYNTAX

PROCESS EVENTS 

EXAMPLE

This procedure counts to 1,000 until you choose STOP.

r-proevs.p
DEFINE BUTTON stop-it LABEL "STOP".
DEFINE VARIABLE i AS INTEGER.
DEFINE VARIABLE stop-sel AS LOGICAL INITIAL FALSE.
DISPLAY stop-it.

ON CHOOSE OF stop-it
   stop-sel = TRUE.

ENABLE stop-it.
   
DO i = 1 TO 1000:  
  DISPLAY i VIEW-AS TEXT.
  
  PROCESS EVENTS.
   
  IF stop-sel 
  THEN LEAVE. 
END. 

On each pass through the loop, the procedure displays the new value of i 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 i equals 1,000.

NOTES

SEE ALSO

WAIT-FOR Statement


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095