SLEEP Statement ---------------------------------------------------------------------------- Action Suspends execution of the calling program. Syntax SLEEP seconds& Remarks The optional argument seconds& determines the number of seconds to suspend the program. The SLEEP statement suspends the program until one of the following events occurs. - The time period in the argument seconds& has elapsed. - A key is pressed. - An enabled event occurs. A BASIC event is one you can trap with an ON event statement such as ON COM or ON TIMER. A BASIC event cannot interrupt a SLEEP suspension unless its trapping is active when the event occurs. This means that trapping must have been initialized with an ON event statement, turned on with an event ON statement, and not have been disabled with an event OFF statement or an event STOP statement. If seconds& is 0 or is omitted, the program is suspended until a key is pressed or an enabled event occurs. SLEEP responds only to keystrokes that occur after it executes. SLEEP ignores characters in the keyboard buffer that were typed before it executed. See Also WAIT Example The following example suspends execution for 10 seconds. There is no ON event statement, so the only way to interrupt the suspension before 10 seconds have passed is to press a key. CLS ' Clear the screen. PRINT "Taking a 10 second nap..." SLEEP 10 PRINT "Awake!" END