Hi,

Is it possible to repeat an arbitrary set of tasks with a user-defined exit condition? If not, could I propose this as a new task?

The "foreach" task lets you iterate over a certain set of prescribed structures, but it would be nice to have something which simply provides an uncomplicated

looping construct. For example:

<property name="var1" value="0"/>

<repeat test="${var1 &lt; 10}">

<echo message="${var1}"/>

<property name="var1" value="${convert::to-int(var1)+1}"/>

</repeat>

Currently I implement this with a "call" task, which doesn't really have the right semantics, and means I have to initialise var1 from inside a different

template, which tends to break the encapsulation.

I don't see the need for a fully fledged "for/next" loop; I believe a "repeat" task would be just as flexible and more suited to those situations where the

looping condition isn't a simple increment.

Regards,

Alex

Reply via email to