Top  >  Lycia reference  >  Querix 4GL  >  Statements  >  SLEEP

SLEEP

 

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.