velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Poll: IteratorTool usage
Date Mon, 19 Nov 2007 23:11:12 GMT

Nathan Bubna wrote:
> #foreach( $item in $$items) )
> $item
> #if( $item eq 'some break condition' )$loop.break()#end
> #end

If you're going to support "break", how about supporting "continue" as
well (restart loop from the top after iterator increment).

I wonder how this would jive with nested loops. Based upon the syntax
above, I wonder if it would be possible to break an inner loop without
breaking the outer loop (it looks like not). While IteratorTool does not
appear to directly support nested loops, I think such support would be a
great goal.


View raw message