<?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: Simple Looping Question in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Simple-Looping-Question/m-p/779425#M96055</link>
    <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;For each row&lt;/FONT&gt; is a for loop like &lt;FONT face="courier new,courier"&gt;for()&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;for each()&lt;/FONT&gt;. So, you can use it directly like in the example below, no need to combine it with a for loop.&lt;BR /&gt;There are also other possibilities to set the values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

minYear = 1947;
maxYear = 2024;

dt1 = New Table ("Years by Quarter",
	Add Rows (maxYear - minYear +1),
	New Column("Year", Ordinal) 
);
for each row(:Year = row()-1+ minYear);

dt2 = New Table ("Years by Quarter",
	Add Rows (maxYear - minYear +1),
	New Column("Year", Ordinal, set each value(row()-1+ minYear)) 
);

myYears = 1947::2024;
dt3 = New Table ("Years by Quarter",
	Add Rows (maxYear - minYear +1),
	New Column("Year", Ordinal, set values(myYears)) 
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Aug 2024 19:37:19 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2024-08-05T19:37:19Z</dc:date>
    <item>
      <title>Simple Looping Question</title>
      <link>https://community.jmp.com/t5/Discussions/Simple-Looping-Question/m-p/779414#M96053</link>
      <description>&lt;P&gt;I have what I think is a very simple looping question. I've looked in the scripting index and scripting guide and I just can't seem to figure it out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All I need to do is to create a table with a list of years beginning with defined earliest year and going to a defined latest year. So say 1960, 1961, 1962, etc. with one year in each row. The script I am using returns a blank column. Here it is...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

minYear = 1947;
maxYear = 2024;

dt = New Table ("Years by Quarter",
	Add Rows (maxYear - minYear),
	New Column("Year", Ordinal) 
);

For (i=minYear, i&amp;lt;maxYear, i++, for each row(i));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Can someone tell me what I'm missing here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks much as always.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 19:28:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Simple-Looping-Question/m-p/779414#M96053</guid>
      <dc:creator>scott1588</dc:creator>
      <dc:date>2024-08-05T19:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Looping Question</title>
      <link>https://community.jmp.com/t5/Discussions/Simple-Looping-Question/m-p/779425#M96055</link>
      <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;For each row&lt;/FONT&gt; is a for loop like &lt;FONT face="courier new,courier"&gt;for()&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;for each()&lt;/FONT&gt;. So, you can use it directly like in the example below, no need to combine it with a for loop.&lt;BR /&gt;There are also other possibilities to set the values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

minYear = 1947;
maxYear = 2024;

dt1 = New Table ("Years by Quarter",
	Add Rows (maxYear - minYear +1),
	New Column("Year", Ordinal) 
);
for each row(:Year = row()-1+ minYear);

dt2 = New Table ("Years by Quarter",
	Add Rows (maxYear - minYear +1),
	New Column("Year", Ordinal, set each value(row()-1+ minYear)) 
);

myYears = 1947::2024;
dt3 = New Table ("Years by Quarter",
	Add Rows (maxYear - minYear +1),
	New Column("Year", Ordinal, set values(myYears)) 
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 19:37:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Simple-Looping-Question/m-p/779425#M96055</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-08-05T19:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Looping Question</title>
      <link>https://community.jmp.com/t5/Discussions/Simple-Looping-Question/m-p/779426#M96056</link>
      <description>&lt;P&gt;Here is one way to do it&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

minYear = 1947;
maxYear = 2024;

dt = New Table( "Years by Quarter",
	Add Rows( maxYear - minYear ),
	New Column( "Year",
		Ordinal,
		set each value( minYear + Row() )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Aug 2024 19:38:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Simple-Looping-Question/m-p/779426#M96056</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-08-05T19:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Looping Question</title>
      <link>https://community.jmp.com/t5/Discussions/Simple-Looping-Question/m-p/779431#M96058</link>
      <description>&lt;P&gt;Thanks to both of you! Gradually I am starting the get the hang of JSL.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 20:00:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Simple-Looping-Question/m-p/779431#M96058</guid>
      <dc:creator>scott1588</dc:creator>
      <dc:date>2024-08-05T20:00:49Z</dc:date>
    </item>
  </channel>
</rss>

