waitDepth

returns the number of nested wait commands currently pending.

# Metadata

Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 1.1 Security:

# Syntax

the waitDepth

# Examples

the waitDepth

if the waitDepth > 10 then beep

# Description

Use the waitDepth function to determine how many wait commands are currently awaiting completion.

The wait with messages form of the wait command, when used in a handler, pauses that handler while allowing LiveCode to execute other handlers while waiting. The waitDepth function indicates how many such statements are currently execute--that is, how many handlers are currently paused by a wait with messages statement.

If there are no paused handlers, the waitDepth function returns 1.

# Tags

# See

- **keyword:** integer - **command:** wait - **glossary:** handler, statement, command, return, execute - **control structure:** function