1

I need to do 500 times loop. Is there better way rather than

<property name="javato.activetesting.trialnum.list" value="0,1,2,...,500(terrible)" />

<for param="trialnum" list="${javato.activetesting.trialnum.list}">
   <sequential>
       <echo message="Sub-iteration:@{trialnum}" />
       <echo message="................" />
    </sequential>
</for>

I'm not sure how to progress this - any suggestions?

thekbb
  • 7,668
  • 1
  • 36
  • 61
JavaGuy
  • 21
  • 2
  • 1
    possible duplicate of [Iterate over for loop with fixed amount of iterations](http://stackoverflow.com/questions/20265016/iterate-over-for-loop-with-fixed-amount-of-iterations) – Mark O'Connor Jan 27 '14 at 21:18
  • It's too terrible for duplicate 500 times . Oh My God – JavaGuy Jan 28 '14 at 15:31

1 Answers1

0

Antelope has an additional task called repeat which can be used like this:

 <taskdef name="repeat" classname="ise.antelope.tasks.Repeat"/>
 <repeat count="2" interval="1" unit="milliseconds">
     <echo>${count}</echo>
 </repeat>

Also found this solution from another question:

<target name="example4">
    <property name="n" value="3300"/>
    <property name="target" value="callee"/>
    <property name="param" value="calleeparam"/>
    <script language="javascript">
    // does n antcall's with iteration number param
    var n = parseInt(project.getProperty("n"),10);
    for (var i = 0; i &lt; n; i++) {
        var t = project.createTask("antcall");
        t.setTarget(project.getProperty("target"));
        var p = t.createParam();
        p.setName(project.getProperty("param"));
        p.setValue(""+i);
        t.perform();
    }
    </script>
</target>
Community
  • 1
  • 1
R. Oosterholt
  • 7,720
  • 2
  • 53
  • 77
  • Thank you for your suggestion with Antelope. I try it but it seems too slow to iterate, one iterate just echo its value. How can I make it faster? – JavaGuy Jan 28 '14 at 15:55
  • updated answer: added `interval` to repeat task. According to the [documentation](http://antelope.tigris.org/nonav/docs/manual/bk03ch24.html) omitting `interval` results in one loop only ("to avoid a tight loop"). – R. Oosterholt Jan 28 '14 at 15:59