velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: question about loops
Date Tue, 06 Aug 2002 10:05:10 GMT
On 8/5/02 5:00 PM, "Greg Frohn" <> wrote:

> I've been using velocity for a while now, and for the most part I love
> it.  I'm wondering why are there no for/while loops for VTL?
> The foreach loop can be a bit limiting...especially since VTL doesn't
> seem to support break or continue.
> I'd love for our web developers to be able to do simple things like
> print out the first n elements in a List.  I understand that this can be
> done using range operators and get methods, but having
> while/for/break/continue seems to be much cleaner for many tasks.
> Just wondering what your thoughts/reasons are for not including them.

The problem we are trying to avoid is runaway loops :



  #for( $I= 0; $I < 10; $I = $I -1 )

With a foreach, it's awfully hard to make simple mistakes that lead to these
kinds of problems.

Geir Magnusson Jr. 
Research & Development, Adeptra Inc.

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

View raw message