<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, How to create labels for each result of commands embedded in a do-loop?</title>
    <link>http://www.mapleprimes.com/questions/95005-How-To-Create-Labels-For-Each-Result</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Fri, 12 Jun 2026 21:17:11 GMT</lastBuildDate>
    <pubDate>Fri, 12 Jun 2026 21:17:11 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, How to create labels for each result of commands embedded in a do-loop?</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, How to create labels for each result of commands embedded in a do-loop?</title>
      <link>http://www.mapleprimes.com/questions/95005-How-To-Create-Labels-For-Each-Result</link>
    </image>
    <item>
      <title>How about storing the answers in a table or Vector?</title>
      <link>http://www.mapleprimes.com/questions/95005-How-To-Create-Labels-For-Each-Result?ref=Feed:MaplePrimes:How to create labels for each result of commands embedded in a do-loop?:Comments#answer95023</link>
      <itunes:summary>&lt;p&gt;Hi afeddersen,&lt;/p&gt;
&lt;p&gt;Sorry - I seem to have a habit of answering direct questions with "here is something different you could do that might accomplish your goals in a better manner", and I'm afraid this is going to be such an answer.&lt;/p&gt;
&lt;p&gt;The label feature in Maple is great, but it mostly works with direct user interaction: there's no easy access to programmatically retrieve the value of label (&lt;em&gt;x&lt;/em&gt;.&lt;em&gt;y&lt;/em&gt;) for example, if &lt;em&gt;x&lt;/em&gt; and &lt;em&gt;y&lt;/em&gt; are integers; instead you have to enter these numbers manually. Loops, of course, are very much programmatic constructs, and thus these two don't mesh very well.&lt;/p&gt;
&lt;p&gt;One option would be to just store whatever value is printed out in a  &lt;a href="http://www.maplesoft.com/support/help/view.aspx?path=table"&gt;?table&lt;/a&gt; or an  &lt;a href="http://www.maplesoft.com/support/help/view.aspx?path=rtable"&gt;?rtable&lt;/a&gt; (such as a  &lt;a href="http://www.maplesoft.com/support/help/view.aspx?path=Vector"&gt;?Vector&lt;/a&gt;). So if you have a loop that looks like this:&lt;/p&gt;
&lt;pre&gt;running_total := 0;&lt;br&gt;for i to 25 do&lt;br&gt;&amp;nbsp; running_total := running_total + i:&lt;br&gt;&amp;nbsp; i^2 - running_total;&lt;br&gt;end do;&lt;/pre&gt;
&lt;p&gt;to print the numbers&lt;em&gt; i&lt;/em&gt;*(&lt;em&gt;i&lt;/em&gt;-1)/2, you could instead decide to store these in a Vector:&lt;/p&gt;
&lt;pre&gt;results := Vector(25);&lt;br&gt;running_total := 0;&lt;br&gt; for i to 25 do&lt;br&gt; &amp;nbsp; running_total := running_total + i:&lt;br&gt; &amp;nbsp; results[i] := i^2 - running_total;&lt;br&gt; end do;&lt;/pre&gt;
&lt;p&gt;Now you can access the &lt;em&gt;i&lt;/em&gt;th value as &lt;em&gt;results&lt;/em&gt;[&lt;em&gt;i&lt;/em&gt;] - with the added advantage over labels that it also works programmatically, not just when you type it directly. Does that help for what you're trying to do?&lt;/p&gt;
&lt;p&gt;Erik Postma&lt;br&gt;Maplesoft.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Hi afeddersen,&lt;/p&gt;
&lt;p&gt;Sorry - I seem to have a habit of answering direct questions with "here is something different you could do that might accomplish your goals in a better manner", and I'm afraid this is going to be such an answer.&lt;/p&gt;
&lt;p&gt;The label feature in Maple is great, but it mostly works with direct user interaction: there's no easy access to programmatically retrieve the value of label (&lt;em&gt;x&lt;/em&gt;.&lt;em&gt;y&lt;/em&gt;) for example, if &lt;em&gt;x&lt;/em&gt; and &lt;em&gt;y&lt;/em&gt; are integers; instead you have to enter these numbers manually. Loops, of course, are very much programmatic constructs, and thus these two don't mesh very well.&lt;/p&gt;
&lt;p&gt;One option would be to just store whatever value is printed out in a  &lt;a href="http://www.maplesoft.com/support/help/view.aspx?path=table"&gt;?table&lt;/a&gt; or an  &lt;a href="http://www.maplesoft.com/support/help/view.aspx?path=rtable"&gt;?rtable&lt;/a&gt; (such as a  &lt;a href="http://www.maplesoft.com/support/help/view.aspx?path=Vector"&gt;?Vector&lt;/a&gt;). So if you have a loop that looks like this:&lt;/p&gt;
&lt;pre&gt;running_total := 0;&lt;br&gt;for i to 25 do&lt;br&gt;&amp;nbsp; running_total := running_total + i:&lt;br&gt;&amp;nbsp; i^2 - running_total;&lt;br&gt;end do;&lt;/pre&gt;
&lt;p&gt;to print the numbers&lt;em&gt; i&lt;/em&gt;*(&lt;em&gt;i&lt;/em&gt;-1)/2, you could instead decide to store these in a Vector:&lt;/p&gt;
&lt;pre&gt;results := Vector(25);&lt;br&gt;running_total := 0;&lt;br&gt; for i to 25 do&lt;br&gt; &amp;nbsp; running_total := running_total + i:&lt;br&gt; &amp;nbsp; results[i] := i^2 - running_total;&lt;br&gt; end do;&lt;/pre&gt;
&lt;p&gt;Now you can access the &lt;em&gt;i&lt;/em&gt;th value as &lt;em&gt;results&lt;/em&gt;[&lt;em&gt;i&lt;/em&gt;] - with the added advantage over labels that it also works programmatically, not just when you type it directly. Does that help for what you're trying to do?&lt;/p&gt;
&lt;p&gt;Erik Postma&lt;br&gt;Maplesoft.&lt;/p&gt;</description>
      <guid>95023</guid>
      <pubDate>Mon, 12 Jul 2010 22:44:12 Z</pubDate>
      <itunes:author>epostma</itunes:author>
      <author>epostma</author>
    </item>
    <item>
      <title>I am not able to understand this concept</title>
      <link>http://www.mapleprimes.com/questions/95005-How-To-Create-Labels-For-Each-Result?ref=Feed:MaplePrimes:How to create labels for each result of commands embedded in a do-loop?:Comments#answer103004</link>
      <itunes:summary>&lt;p&gt;I am not able to understand this concept but i guess i might have confused you with my wordings in the problem.....i simply want a label ,in the sense...A= ,B=,C=...for the list of expressions being generated in the loop..i do not want to refer to them in any other place&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;I am not able to understand this concept but i guess i might have confused you with my wordings in the problem.....i simply want a label ,in the sense...A= ,B=,C=...for the list of expressions being generated in the loop..i do not want to refer to them in any other place&lt;/p&gt;</description>
      <guid>103004</guid>
      <pubDate>Sat, 26 Mar 2011 02:09:04 Z</pubDate>
      <itunes:author>elango8</itunes:author>
      <author>elango8</author>
    </item>
  </channel>
</rss>