Consultor Eletrônico



Kbase P101625: How to update user interface from with a FOR EACH block
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   2/28/2005
Status: Unverified

GOAL:

How to update user interface from with a FOR EACH block

FIX:

The default behavior of the 4GL while in a FOR EACH block is to update the user interface very rarely under the assumption that performance is more important than user interface updates. To have the user interface updated periodically from within the FOR EACH block use code similar to the following:
DEFINE VARIABLE iLoop AS INTEGER NO-UNDO.
ASSIGN iLoop = 0.
FOR EACH SomeTable NO-LOCK:

ASSIGN iLoop = iLoop + 1.
IF iLoop MOD 100 = 0 THEN

DO:

ASSIGN iLoop = 0.
/* Code Goes Here To Update User Interface */
PROCESS EVENTS.
END.
END.