Refreshing the user interface

When a program executes an instruction displaying information to the user, IBM® Informix® 4GL (I4GL) refreshes the screen immediately.

For example, when doing successive DISPLAY ... AT instructions in a loop, I4GL will show screen changes for each DISPLAY instruction:
MAIN
    DEFINE i INTEGER
    FOR i=1 TO 5000000
        DISPLAY i AT 2,2
    END FOR
END MAIN

Genero Business Development Language (BDL) handles screen refreshing differently:

To optimize the display for graphical front-ends, the runtime system will only refresh the screen, when the user gets the control. This means, when an interactive intruction (a dialog) waits for a user interaction.

With the above code, when using FGLGUI=0 to run in text mode, the screen will not show the numbers.

In order to display the numbers to the end user, force the screen refresh with an ui.Interface.refresh() API call. Note that the user interface should be refreshed periodically rather than continuously, to avoid network clogging. This is the reason for the (i MOD 100)==0 test:
MAIN
    DEFINE i INTEGER
    FOR i=1 TO 5000000
        DISPLAY i AT 2,2
        IF (i MOD 1000) == 0 THEN
           CALL ui.Interface.refresh()
        END IF
    END FOR
END MAIN
Important: Genero's special refresh behavior (delaying the output until the runtime waits for a user interaction) does in most cases not introduce any display problem in legacy programs. Special attention is required, if some information must be visible immediately and the runtime continues with processing code. A typical example is a "Please wait..." message, displayed just before a long processing.