<?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 with increments different of one in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/For-loop-with-increments-different-of-one/m-p/281353#M54485</link>
    <description>&lt;P&gt;++ is a &lt;A href="https://www.jmp.com/support/help/en/15.1/index.shtml#page/jmp/operators.shtml" target="_self"&gt;postfix operator&lt;/A&gt; that has the effect of incrementing in place.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no general purpose postfix operator to increment by an arbitrary value. Instead you'll need to use the assignment operator (=) to assign the result back to your counter:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;for(i=1, i&amp;lt;=20, i=i+2,
	show(i)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in the log you'll get:&lt;/P&gt;
&lt;PRE&gt;/*:
//:*/
for(i=1, i&amp;lt;=20, i=i+2,
	show(i)
);
/*:

i = 1;
i = 3;
i = 5;
i = 7;
i = 9;
i = 11;
i = 13;
i = 15;
i = 17;
i = 19;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jul 2020 12:18:19 GMT</pubDate>
    <dc:creator>Jeff_Perkinson</dc:creator>
    <dc:date>2020-07-23T12:18:19Z</dc:date>
    <item>
      <title>For loop with increments different of one</title>
      <link>https://community.jmp.com/t5/Discussions/For-loop-with-increments-different-of-one/m-p/281344#M54482</link>
      <description>&lt;P&gt;I have a script which creates graphs of x (time) with respect to two consecutive columns (x). I pretend that "i" instead of increasing one by one, I do it two by two.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is part of the script:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; i &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; i &lt;SPAN&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN&gt;N Items&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; numericColNames &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; i&lt;SPAN&gt;++,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I change the iteration term to i+2 the script it enter in an loop without end&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:33:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/For-loop-with-increments-different-of-one/m-p/281344#M54482</guid>
      <dc:creator>gallardet</dc:creator>
      <dc:date>2023-06-09T23:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: For loop with increments different of one</title>
      <link>https://community.jmp.com/t5/Discussions/For-loop-with-increments-different-of-one/m-p/281353#M54485</link>
      <description>&lt;P&gt;++ is a &lt;A href="https://www.jmp.com/support/help/en/15.1/index.shtml#page/jmp/operators.shtml" target="_self"&gt;postfix operator&lt;/A&gt; that has the effect of incrementing in place.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no general purpose postfix operator to increment by an arbitrary value. Instead you'll need to use the assignment operator (=) to assign the result back to your counter:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;for(i=1, i&amp;lt;=20, i=i+2,
	show(i)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in the log you'll get:&lt;/P&gt;
&lt;PRE&gt;/*:
//:*/
for(i=1, i&amp;lt;=20, i=i+2,
	show(i)
);
/*:

i = 1;
i = 3;
i = 5;
i = 7;
i = 9;
i = 11;
i = 13;
i = 15;
i = 17;
i = 19;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 12:18:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/For-loop-with-increments-different-of-one/m-p/281353#M54485</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2020-07-23T12:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: For loop with increments different of one</title>
      <link>https://community.jmp.com/t5/Discussions/For-loop-with-increments-different-of-one/m-p/282743#M54709</link>
      <description>Thanks!&lt;BR /&gt;</description>
      <pubDate>Wed, 29 Jul 2020 16:29:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/For-loop-with-increments-different-of-one/m-p/282743#M54709</guid>
      <dc:creator>gallardet</dc:creator>
      <dc:date>2020-07-29T16:29:55Z</dc:date>
    </item>
  </channel>
</rss>

