SLEEP Statement

The SLEEP statement causes program execution to pause for a specified number of seconds.

Format

SLEEP expr

RQM expr

Parameter(s)

expr

An expression evaluating to the number of seconds to sleep for, or to a specific time in the form of a 24-hour clock. To specify a time, expr should be of the form:

hh:mm [:ss]

representing the hour, minute, and (optionally) second to sleep until.

Description

The SLEEP statement suspends execution of a program for a specified number of seconds, or until a given time of day. The SLEEP statement is functionally the same as the RQM statement.

When the BREAK key is used during a sleep, the sleep is disabled and program execution continues immediately with the next statement after the sleep. The BREAK key disables the sleep regardless of whether the BREAK OFF statement was used to prevent the user from entering the Debugger.

Example

In this application, the program sleeps until 3PM, and then sends a beep to the screen as a reminder to the user.

SLEEP 15:00

PRINT CHAR(7)

See Also

Statement and Function Reference