<doc>
  <legacy_id>1032</legacy_id>
  <name>exit</name>
  <type>control structure</type>
  <syntax>
    <example>exit <i>handler</i></example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Writing LiveCode</category>
  </classification>
  <references>
    <control_st tag="break">break Control Structure</control_st>
    <control_st tag="exit repeat">exit repeat Control Structure</control_st>
    <control_st tag="exit to top">exit to top Control Structure</control_st>
    <control_st tag="getProp">getProp Control Structure</control_st>
    <control_st tag="on">on Control Structure</control_st>
    <control_st tag="pass">pass Control Structure</control_st>
    <control_st tag="return">return Control Structure</control_st>
    <control_st tag="setProp">setProp Control Structure</control_st>
    <control_st tag="function">function Control Structure</control_st>
  </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>Stops <glossary tag="execute">execution</glossary> of a <glossary tag="handler">handler</glossary>.</summary>
  <examples>
    <example>if the seconds &gt; timeLimit then exit mouseUp</example>
    <example>exit myCustomProperty <code><i>-- can be used in getProp or setProp handlers</i></code></example>
  </examples>
  <description>
    <p>Use the <b>exit</b> <glossary tag="control structure">control structure</glossary> to skip the rest of a <glossary tag="handler">handler's</glossary> <glossary tag="statement">statements</glossary> without <glossary tag="return">returning</glossary> a result.</p><p/><p><b>Form:</b></p><p>The <b>exit</b> <glossary tag="statement">statement</glossary> appears on a line by itself, anywhere inside a <glossary tag="handler">handler</glossary>.</p><p/><p><b>Parameters:</b></p><p>The <i>handler</i> is the name of the <glossary tag="handler">handler</glossary> in which the <b>exit</b> <glossary tag="control structure">control structure</glossary> appears.</p><p/><p><b>Comments:</b></p><p>You can use an <b>exit</b> <glossary tag="control structure">control structure</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>. Usually, <b>exit</b> is used within an <control_st tag="if">if</control_st> <glossary tag="control structure">control structure</glossary>, so that the <glossary tag="handler">handler</glossary> stops if a condition is true and continues if the condition is false.</p><p/><p>If the current handler was called from another handler, the calling handler continues executing. The <b>exit</b> <glossary tag="statement">statement</glossary> only stops the current <glossary tag="handler">handler</glossary>, not the <glossary tag="caller">calling handler</glossary>. (To stop all pending <glossary tag="handler">handlers</glossary>, use the <control_st tag="exit to top">exit to top</control_st> <glossary tag="control structure">control structure</glossary>.)</p><p/><p>When a handler executes an <b>exit</b> <glossary tag="statement">statement</glossary>, the <keyword tag="message box">message</keyword>, <glossary tag="trigger">trigger</glossary>, <glossary tag="function call">function call</glossary>, or <glossary tag="getProp call">getProp call</glossary> stops and 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> on through 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. To halt the current <glossary tag="handler">handler</glossary> and return a result, use the <constant tag="return">return</constant> <glossary tag="control structure">control structure</glossary> instead.</p><p/><p><code/><b>Note:</b><code/> The <b>exit</b> <glossary tag="control structure">control structure</glossary> is implemented internally as a <glossary tag="command">command</glossary> and appears in the <function tag="commandNames">commandNames</function>.</p>
  </description>
</doc>