<?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 Re: for loop stopping in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/for-loop-stopping/m-p/537341#M75886</link>
    <description>&lt;P&gt;Does each code in each iteration depend on the data tables that you are closing within the For() function?&lt;/P&gt;</description>
    <pubDate>Thu, 25 Aug 2022 15:21:25 GMT</pubDate>
    <dc:creator>Mark_Bailey</dc:creator>
    <dc:date>2022-08-25T15:21:25Z</dc:date>
    <item>
      <title>for loop stopping</title>
      <link>https://community.jmp.com/t5/Discussions/for-loop-stopping/m-p/537331#M75885</link>
      <description>&lt;P&gt;I'm stumped at the moment on an issue with a FOR loop.&amp;nbsp; (using JMP16)&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// open a window
mywindow = New Window(" xyz ", .....etc.);

// create journal
myjrn = mywindow &amp;lt;&amp;lt; journal window;&amp;nbsp;

For( i = 1, i &amp;lt;= 100, i++, &amp;nbsp;

// do a lot of lines of lines requiring about 5' run time.
	// periodically journal objects.

	Close All( data tables, no save )
);&amp;nbsp; // end to for loop

// SAVE the journal:
myjrn &amp;lt;&amp;lt; save journal( "my.jrn" );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The loop stops after an iteration.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(I can restart the loop after the for (i=1, i&amp;lt;=100, i++,&amp;nbsp; &amp;nbsp;stops and doesn't proceed to i=2.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for (i=2,i&amp;lt;=100, i++,&amp;nbsp; stops and doesn't proceed to i=3.&lt;/P&gt;
&lt;P&gt;for (i=3,i&amp;lt;=100, i++, stops and doesn't process to i=4.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Welcoming thoughts on what is causing this? resolution?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;John&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 17:08:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/for-loop-stopping/m-p/537331#M75885</guid>
      <dc:creator>johnm</dc:creator>
      <dc:date>2023-06-09T17:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: for loop stopping</title>
      <link>https://community.jmp.com/t5/Discussions/for-loop-stopping/m-p/537341#M75886</link>
      <description>&lt;P&gt;Does each code in each iteration depend on the data tables that you are closing within the For() function?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 15:21:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/for-loop-stopping/m-p/537341#M75886</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2022-08-25T15:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: for loop stopping</title>
      <link>https://community.jmp.com/t5/Discussions/for-loop-stopping/m-p/537355#M75887</link>
      <description>&lt;P&gt;Without seeing all the code it's difficult to diagnose.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First check the log window for any errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there are none, then&amp;nbsp;I'd start with looking at the value of i after the For() loop. I suspect you'll find it's greater than 100. Then you need to see where it is getting changed inadvertently. This can occasionally happen with name collisions with columns in a data table. If you just can't figure out where that could be happening, try changing the i to something else and see if it starts working. That will confirm the name collision.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 15:45:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/for-loop-stopping/m-p/537355#M75887</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2022-08-25T15:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: for loop stopping</title>
      <link>https://community.jmp.com/t5/Discussions/for-loop-stopping/m-p/537357#M75888</link>
      <description>&lt;P&gt;Is it possible that somewhere in your Fro() loop, that you are setting the variable "i" to a large value?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 15:26:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/for-loop-stopping/m-p/537357#M75888</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-08-25T15:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: for loop stopping</title>
      <link>https://community.jmp.com/t5/Discussions/for-loop-stopping/m-p/537364#M75889</link>
      <description>&lt;P&gt;Do you have other parts of code using "i" as a variable?&amp;nbsp; Could the variable be getting reassigned (e.g. if you are using user-defined functions)?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 15:45:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/for-loop-stopping/m-p/537364#M75889</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2022-08-25T15:45:32Z</dc:date>
    </item>
  </channel>
</rss>

