ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From EXT / FOCAL MALAPRADE Roland <ext.focal.malapr...@sncf.fr>
Subject RE: If anybody is interested.. [foreach] task which doesnt run ou t of memory.
Date Wed, 18 Sep 2002 13:41:42 GMT
I've been trying to use it with an <if> task as so:

<target name="main">
  <foreach2 param="letter" list="a,b,c">
    <do>
      <if>
        <isset property="letter"/>
        <then>
          <foreach2 param="number" list="1,2,3">
            <do>
              <if>
                <isset property="letter"/>
                <then>
                  <echo message="combi is ${letter}${number}"/>
                </then>
                <else>
                  <echo message="number not set" />
                </else>
              </if>
            </do>
          </foreach2>
        </then>
        <else>
          <echo message="letter not set" />
        </else>
      </if>
    </do>
  </foreach2>

and this build script displays:
main:
     [echo] combi is a1
     [echo] combi is a1
     [echo] combi is a1
     [echo] combi is a1
     [echo] combi is a1
     [echo] combi is a1
     [echo] combi is a1
     [echo] combi is a1
     [echo] combi is a1

Do you know why this is?

</target>-----Message d'origine-----
De : Geoff Meakin [mailto:geoffm@isocra.com]
Envoyé : mercredi 18 septembre 2002 15:09
À : Ant Users List
Objet : RE: If anybody is interested.. [foreach] task which doesnt run
out of memory.


Yes, it appears so:

<target name="main">
  <foreach2 param="letter" list="a,b,c">
    <do>
      <foreach2 param="number" list="1,2,3">
        <do>
          <echo message="combi is ${letter}${number}"/>
        </do>
      </foreach2>
    </do>
  </foreach2>
</target>

Gives the output:

combi is a1
combi is a2
combi is a3
combi is b1
combi is b2
combi is b3
combi is c1
combi is c2
combi is c3

Cheers
-Geoff


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message