<doc>
  <legacy_id>2487</legacy_id>
  <name>exit to top</name>
  <type>control structure</type>
  <syntax>
    <example>exit to top</example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
    <synonym>exit to MetaCard</synonym>
    <synonym>exit to SuperCard</synonym>
    <synonym>exit to HyperCard</synonym>
  </synonyms>
  <classification>
    <category>Writing LiveCode</category>
  </classification>
  <references>
    <control_st tag="exit">exit Control Structure</control_st>
    <keyword tag="top">top Keyword</keyword>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>Halts the current <glossary tag="handler">handler</glossary> and all pending <glossary tag="handler">handlers</glossary>.</summary>
  <examples>
    <example>if the result is not empty then exit to top <code><i>-- stop everything</i></code></example>
  </examples>
  <description>
    <p>Use the <b>exit to top</b> <glossary tag="control structure">control structure</glossary> to stop <glossary tag="execute">executing</glossary> the current <glossary tag="handler">handler</glossary> and suppress pending <glossary tag="message">messages</glossary>.</p><p/><p><b>Form:</b></p><p>The <b>exit to top</b> <glossary tag="statement">statement</glossary> appears on a line by itself, anywhere inside a <glossary tag="handler">handler</glossary>.</p><p/><p><b>Comments:</b></p><p>Usually, <b>exit to top</b> is used within an <control_st tag="if">if</control_st> <glossary tag="control structure">control structure</glossary>, so that <glossary tag="execute">execution</glossary> stops if a condition is true and continues if the condition is false.</p><p/><p>You can use an <b>exit to top</b> <glossary tag="statement">statement</glossary> in a <glossary tag="message handler">message handler</glossary>, <glossary tag="function handler">function handler</glossary>, <glossary tag="getProp handler">getProp handler</glossary>, or <glossary tag="setProp handler">setProp handler</glossary>.</p><p/><p>If the current handler was called from another handler, the calling handler is also halted. Other messages that depend on the same action are also suppressed: for example, if an <b>exit to top</b> <glossary tag="control structure">control structure</glossary> is executed in a <message tag="closeCard">closeCard</message> <glossary tag="handler">handler</glossary>, the corresponding <message tag="openCard">openCard</message> <keyword tag="message box">message</keyword> is not sent to the destination <keyword tag="card">card</keyword>.</p><p/><p><code/><img src="202653"/> <b>Important!</b><code/> When a <glossary tag="handler">handler</glossary> <glossary tag="execute">executes</glossary> an <b>exit to top</b> <glossary tag="statement">statement</glossary>, the <keyword tag="message box">message</keyword>, setProp <glossary tag="trigger">trigger</glossary>, <glossary tag="function call">function call</glossary>, or <glossary tag="getProp call">getProp call</glossary> is not <glossary tag="pass">passed</glossary> to the next <glossary tag="object">object</glossary> in the <glossary tag="message path">message path</glossary>. To halt the current <glossary tag="handler">handler</glossary> and <control_st tag="pass">pass</control_st> the <keyword tag="message box">message</keyword>, <glossary tag="trigger">trigger</glossary>, or <command tag="call">call</command> to the next <glossary tag="object">object</glossary> in the <glossary tag="message path">message path</glossary>, use the <control_st tag="pass">pass</control_st> <glossary tag="control structure">control structure</glossary> instead of <control_st tag="exit">exit</control_st> or <b>exit to top</b>.</p>
  </description>
</doc>