<doc>
  <legacy_id>2374</legacy_id>
  <name>exit repeat</name>
  <type>control structure</type>
  <syntax>
    <example>exit repeat</example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Writing LiveCode</category>
  </classification>
  <references>
    <control_st tag="exit">exit Control Structure</control_st>
    <control_st tag="next repeat">next repeat 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>Skips the rest of the current <control_st tag="repeat">repeat</control_st> <glossary tag="loop">loop</glossary> and goes to the <glossary tag="statement">statement</glossary> following the <keyword tag="end repeat">end repeat</keyword>.</summary>
  <examples>
    <example>if x &gt; 0 then exit repeat</example>
  </examples>
  <description>
    <p>Use the <b>exit repeat</b> <glossary tag="control structure">control structure</glossary> to skip the rest of a <control_st tag="repeat">repeat</control_st> <glossary tag="loop">loop</glossary>.</p><p/><p><b>Form:</b></p><p>The <b>exit repeat</b> <glossary tag="statement">statement</glossary> appears on a line by itself, anywhere inside a <b>repeat</b> <glossary tag="control structure">control structure</glossary>.</p><p/><p><b>Comments:</b></p><p>After an <b>exit repeat</b> <glossary tag="statement">statement</glossary>, none of the remaining <glossary tag="statement">statements</glossary> in the current <glossary tag="loop">loop</glossary> is <glossary tag="execute">executed</glossary>, and any more <glossary tag="loop">loops</glossary> are skipped. The <glossary tag="handler">handler</glossary> <glossary tag="resume">resumes</glossary> <glossary tag="execute">executing</glossary> at the first <glossary tag="statement">statement</glossary> after the end of the <control_st tag="repeat">repeat</control_st> <glossary tag="loop">loop</glossary>.</p><p/><p>Usually, <b>exit repeat</b> is used within an <control_st tag="if">if</control_st> <glossary tag="control structure">control structure</glossary>, so that the <glossary tag="loop">loop</glossary> stops if a condition is true and continues if the condition is false. This example stops the <glossary tag="loop">loop</glossary> when the user presses the mouse button:</p><p/><p><code>  repeat with x = 1 to the number of cards</code></p><p><code>    go card x</code></p><p><code>    if the mouse is down then exit repeat </code><code><i>-- bail out</i></code></p><p><code>  end repeat</code></p>
  </description>
</doc>