velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Dekany <>
Subject Re: How can I break a Foreach loop?
Date Thu, 09 Oct 2003 12:48:58 GMT
Thursday, October 9, 2003, 1:09:38 PM, wrote:

> Next are some hints on how to break a #foreach loop in velocity.
> There are many ways to skin a cat ;)
> For the most cases a solution simlar to Mike's one does the
> trick - when the count is not very large. A simple #if
> with the proper condition just skips the body processing
> A further solution (a previous thread in the vel-user list has
> treated this) is to create a simple tool, lets call it
> BreakableIterator, possibly reusing velocity's iterator introspection
> mechanism, and add a break() method that tells it to return false
> for the next hasNext() call.

It seems that it is a frequent problem of Vel. users. Was it considered
to, simply, introduce directive #break to the Vel. core?

Best regards,
 Daniel Dekany

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message