AUTOREFRESH clause

Productivity and performance of a program can be improved by managing the refreshment modes. The first refreshment mode allows you to reach maximum performance, since the program does not need to display anything until it waits for the user input and thus the calculations can go faster.

 

Lycia offers three refreshment modes:

  1. The output of all the DISPLAY statements (DISPLAY, DISPLAY TO, DISPLAY AT, DISPLAY FORM) and the visual indication of adding or removing a row to an array will be visible only when the program executes a user interaction statement located further in the code and waits for the user input. The user indication statements can be INPUT, INPUT ARRAY, DISPLAY ARRAY, MENU, PROMPT and others. To set this refreshment mode, assign value 1 to AUTOREFRESH:

    OPTIONS AUTOREFRESH 1

  2. The output of the DISPLAY statements and alike will be visible either during the user interaction statements, or if the SLEEP statement was executed. This is the default refreshment mode. To invoke this mode, set the value to 2:

    OPTIONS AUTOREFRESH 2

  3. The output of all DISPLAY statements will be visible immediately after they are executed and will not wait for user interaction statements to be in effect. This mode is the slowest of the three and gives the worse performance, but at the same time it gives your program an improved feedback mechanism. To enable this options set the value to 3:

    OPTIONS AUTOREFRESH 3

 

If the first refreshment mode is on, the long SQL queries or other time consuming processes will prevent anything from displaying as long as they are running. If you want to see the output of the display statements while no user interaction statement is in effect, call the ui.interface.refresh() method. It will show the output of all displays executed between the previous user interaction statement and the place this method was called at.

Thus, if you want to keep track of the long database interactions, for example, and display the progress, you should either use the third or second refreshment mode, or use the refresh() method after displaying.

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.