Please enable JavaScript to view this site.

ESL Documentation

Navigation: » No topics above this level «

Q19 How can I ensure the screen is kept updated when running long-winded routines?

Scroll Prev Top Next More

In very long action routines, or in loops, the following code will help your application avoid hogging the processor and thus allow the operating system to re-paint the screen:

ESLLan30

This routine tells ESL to let the Operating System (OS) processes complete before continuing. Because of this, it has many other uses within ESL applications.

Since your ESL application and the OS are processes running concurrently, there may be timing problems. For instance, an ESL application may do processing after requesting the OS to bring up a dialog region or dialog box (hereafter just referred to as a dialog). At that point, there are 2 processes running concurrently. 1)the OS is asked to draw the dialog, and 2) ESL does its processing.

Part of the OS's job is to place the cursor in the first field. If your application's processing activates a different field, there may be a timing problem. I.e. If the ESL application puts the cursor in a certain field before the OS completes drawing the dialog, the cursor may be in the wrong place when the OS completes the redraw. By flushing the message queue, all the OS processing will complete before ESL. If the OS is finished placing the cursor before ESL, everything is fine.

The place to call the flush is not always the most logical. You may need to experiment before it will resolve the problem. Try it at the beginning or end of all routines involved. Usually only one flush is required