Kbase 19926: Clearing Buffered Input Before Ending SESSION:SET-WAIT-STATE
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  27/01/2005 |
|
Status: Unverified
GOAL:
Use PROCESS EVENTS to clear the buffer before returning to an active state.
CAUSE:
Although the SESSION:SET-WAIT-STATE() command blocks user input, it buffers the input attempts. Once the wait-state reverts back to active these inputs are then acted upon. For example if you are in a SESSION:SET-WAIT-STATE() and click on a button, no action is performed. But once the SESSION:SET-WAIT-STATE() ends, the command activated by the button fires.
FIX:
The following code demonstrates the method to clear the buffer:
/*Run this code then click on the button*/
DEFINE BUTTON stop-it LABEL "STOP".
DEFINE VARIABLE i AS INTEGER.
DISPLAY stop-it.
ENABLE stop-it.
ON CHOOSE OF stop-it
MESSAGE "choose" VIEW-AS ALERT-BOX.
SESSION:SET-WAIT-STATE("GENERAL").
DO i = 1 TO 100000:
END.
PROCESS EVENTS. /*Remove this to see normal process*/
SESSION:SET-WAIT-STATE("").
WAIT-FOR CLOSE OF THIS-PROCEDURE.