<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How do I exit the loop when something is satisfied? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-exit-the-loop-when-something-is-satisfied/m-p/77883#M36287</link>
    <description>&lt;P&gt;After the data table is sorted by the age column in ascending order, the cycle is conducted by the age column. When the age is equal to the age of the previous row, n=n+1, otherwise, the cycle is withdrawn.Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt = Open( "$SAMPLE_DATA\Big class.jmp" );&lt;BR /&gt;r = N Row( dt );&lt;BR /&gt;n = 0;&lt;BR /&gt;For( i == 2, i &amp;lt;= r, i++,&lt;BR /&gt;If( dt[i - 1, "age"] = dt[i, "age"],&lt;BR /&gt;n = n + 1,&lt;BR /&gt;stop loop&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2018-10-06_20-34-57.png" style="width: 837px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/12683iB99710222200790F/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-10-06_20-34-57.png" alt="2018-10-06_20-34-57.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Oct 2018 12:41:54 GMT</pubDate>
    <dc:creator>lwx228</dc:creator>
    <dc:date>2018-10-04T12:41:54Z</dc:date>
    <item>
      <title>How do I exit the loop when something is satisfied?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-exit-the-loop-when-something-is-satisfied/m-p/77883#M36287</link>
      <description>&lt;P&gt;After the data table is sorted by the age column in ascending order, the cycle is conducted by the age column. When the age is equal to the age of the previous row, n=n+1, otherwise, the cycle is withdrawn.Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt = Open( "$SAMPLE_DATA\Big class.jmp" );&lt;BR /&gt;r = N Row( dt );&lt;BR /&gt;n = 0;&lt;BR /&gt;For( i == 2, i &amp;lt;= r, i++,&lt;BR /&gt;If( dt[i - 1, "age"] = dt[i, "age"],&lt;BR /&gt;n = n + 1,&lt;BR /&gt;stop loop&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2018-10-06_20-34-57.png" style="width: 837px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/12683iB99710222200790F/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-10-06_20-34-57.png" alt="2018-10-06_20-34-57.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 12:41:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-exit-the-loop-when-something-is-satisfied/m-p/77883#M36287</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2018-10-04T12:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I exit the loop when something is satisfied?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-exit-the-loop-when-something-is-satisfied/m-p/77884#M36288</link>
      <description>&lt;P&gt;You want the BREAK command.&amp;nbsp; From the scripting index:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
For( i = 1, i &amp;lt;= 10, i++,
	If( i == 5, Break() );
	Print( "i=" || Char( i ) );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Oct 2018 12:58:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-exit-the-loop-when-something-is-satisfied/m-p/77884#M36288</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2018-10-04T12:58:35Z</dc:date>
    </item>
  </channel>
</rss>

