<doc>
  <legacy_id>1972</legacy_id>
  <name>waitDepth</name>
  <type>function</type>
  <syntax>
    <example>the waitDepth</example>
    <example>waitDepth()</example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Writing LiveCode</category>
  </classification>
  <references>
    <command tag="wait">wait Command</command>
  </references>
  <history>
    <introduced version="1.1">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary><glossary tag="return">Returns</glossary> the number of nested <command tag="wait">wait commands</command> currently pending.</summary>
  <examples>
    <example>the waitDepth</example>
    <example>if the waitDepth &gt; 10 then beep</example>
  </examples>
  <description>
    <p>Use the <b>waitDepth</b> <control_st tag="function">function</control_st> to determine how many <command tag="wait">wait</command> <glossary tag="command">commands</glossary> are currently awaiting completion.</p><p/><p><b>Value:</b></p><p>The <b>waitDepth</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> a positive <keyword tag="integer">integer</keyword>.</p><p/><p><b>Comments:</b></p><p>The wait with messages form of the <command tag="wait">wait command</command>, when used in a <glossary tag="handler">handler</glossary>, pauses that handler while allowing LiveCode to <glossary tag="execute">execute</glossary> other <glossary tag="handler">handlers</glossary> while waiting. The <b>waitDepth</b> <control_st tag="function">function</control_st> indicates how many such <glossary tag="statement">statements</glossary> are currently <glossary tag="execute">executing</glossary>--that is, how many <glossary tag="handler">handlers</glossary> are currently paused by a wait with messages <glossary tag="statement">statement</glossary>.</p><p/><p>If there are no paused handlers, the <b>waitDepth</b> <control_st tag="function">function</control_st> returns 1.</p><p/>
  </description>
</doc>