Top > Lycia reference > Querix 4GL > Statements > SLEEP
To meet your needs, we constantly work to improve Querix products.
This means that Lycia documentation is developing as well.
In case you have found a certain dissonance between the provided information and the actual behavior of Lycia 3 and/or your applications, please, let us know about this via documentation@querix.com so that we can introduce the necessary changes to our documentation.
Thank you for your attention and cooperation.
SLEEP statement is used to suspend the execution of a program for a certain period of time which is calculated in seconds.
Element |
Description |
Integer Expression |
A 4GL expression that returns a positive integer |
SLEEP keywords are followed by an integer expression which specifies the number of seconds by which the program execution is suspended. This statement might prove useful, if you want a screen display to remain visible long enough for the user to be able to read it.
The example below illustrates the usage of the SLEEP statement for creation of a pause between two messages. Without the SLEEP statement, the second MESSAGE statement would have erased the first one before it could be read:
MESSAGE "You have deleted a row."
SLEEP 2
MESSAGE " "
The PROMPT statement could be used instead of the SLEEP statement in some cases. The above message can be displayed using the PROMPT statement, the user input will erase the PROMPT message and the program execution will be resumed:
PROMPT "The row is deleted. Press any key to continue." FOR CHAR anykey
PROMPT message remains visible until the user presses any key. The value of the anykey variable can be ignored.