Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
SLEEP Statement Details
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
SLEEP [seconds%]
Usage Notes
■ Any reference to the SLEEP statement when forms are showing causes
Visual Basic to generate the error message, "Invalid when forms are
showing."
■ To use the SLEEP statement with forms, you must first unload or hide any
visible forms. See: ◄HIDE Method► ◄UNLOAD Statement►
■ An event (such as ON COM or ON TIMER) 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.
See: ◄Error/Event Trapping Summary►
■ If seconds% is 0, omitted, or a noninteger value, the program execution
is suspended until a key is pressed or a trapped 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.