<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=FORALL</id>
	<title>FORALL - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=FORALL"/>
	<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=FORALL&amp;action=history"/>
	<updated>2026-04-14T23:46:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.ice-online.com/index.php?title=FORALL&amp;diff=840&amp;oldid=prev</id>
		<title>ConvertBot: performs a Midas command for a list of items or counter index</title>
		<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=FORALL&amp;diff=840&amp;oldid=prev"/>
		<updated>2020-04-27T22:05:14Z</updated>

		<summary type="html">&lt;p&gt;performs a Midas command for a list of items or counter index&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;performs a Midas command for a list of items or counter index&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;file/count&amp;gt;	List filename or counter string&lt;br /&gt;
&amp;lt;command&amp;gt;       Midas command to perform&lt;br /&gt;
&lt;br /&gt;
FORALL performs the named command for each item in a list file or for each&lt;br /&gt;
increment of a count variable.  If either argument is left blank, it prompts &lt;br /&gt;
for them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;command&amp;gt; specifies the command to execute for each item, using a # everywhere&lt;br /&gt;
the current item value should be substituted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;file/count&amp;gt; parameter includes an &amp;quot;=&amp;quot; sign, FORALL expects a count&lt;br /&gt;
string of the form:&lt;br /&gt;
&lt;br /&gt;
    #=START:END;INC&lt;br /&gt;
&lt;br /&gt;
where START is the start count, END is the end count, and INC is an optional&lt;br /&gt;
increment.  &amp;lt;command&amp;gt; is executed for each count in the loop progression, with&lt;br /&gt;
the current iteration number substituted for each instance of &amp;quot;#&amp;quot;. For example,&lt;br /&gt;
&lt;br /&gt;
    nM&amp;gt;res n 0&lt;br /&gt;
    nM&amp;gt;forall #=1:21;2 calc n n # +&lt;br /&gt;
&lt;br /&gt;
sums all odd integers from 1 to 21.  Counts and increments are not required to&lt;br /&gt;
be integers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;file/count&amp;gt; parameter does NOT include an &amp;quot;=&amp;quot; sign, FORALL expects the&lt;br /&gt;
name of a file containing a list of strings or numbers.  It loops through each&lt;br /&gt;
element of this file, substituting the indexed item wherever &amp;quot;#&amp;quot; is found in&lt;br /&gt;
&amp;lt;command&amp;gt;.  Often the file will be generated by a FILES/F or MENU/F command:&lt;br /&gt;
&lt;br /&gt;
    nM&amp;gt;files/f t* ,,1&lt;br /&gt;
    nM&amp;gt;forall FILES status #&lt;br /&gt;
&lt;br /&gt;
  will display the status of every file beginning with T.&lt;br /&gt;
  &lt;br /&gt;
  To see the DEFAULTS of each Intrinsic or Macro:&lt;br /&gt;
&lt;br /&gt;
    nM&amp;gt;menu/f ,,, IM&lt;br /&gt;
    nM&amp;gt;forall MENU syntax #&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE: When using FORALL within a macro, note that its arguments are treated&lt;br /&gt;
      like arguments to operating system commands.  The reason is that it is&lt;br /&gt;
      unknown what kind of command you may be giving FORALL.  Thus local result&lt;br /&gt;
      parameter translation will only occur if you use the caret (^) to&lt;br /&gt;
      indicate a result substitution. For example:&lt;br /&gt;
&lt;br /&gt;
      mymacro L:number&lt;br /&gt;
&lt;br /&gt;
	forall #=1:number    ramp r#	! This will NOT work right&lt;br /&gt;
	forall #=1:^number   ramp r#	! This WILL work correctly&lt;br /&gt;
&lt;br /&gt;
      endmacro&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;lt;command&amp;gt; cannot invoke GOTO or CALL.  This is because FORALL is itself&lt;br /&gt;
      a  macro with it's own macro level and local results parameters.  (The &lt;br /&gt;
      labels, procedures and subroutines of the calling macro are not visible&lt;br /&gt;
      to it.)   If you need to call a procedure  repeatedly within a macro use&lt;br /&gt;
      the DO,  FOREACH or WHILE commands.&lt;br /&gt;
&lt;br /&gt;
Switches:&lt;br /&gt;
  /ECHO - Shows each iteration of the command before performing it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:NXM_Explain]]&lt;/div&gt;</summary>
		<author><name>ConvertBot</name></author>
		
	</entry>
</feed>