velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@optonline.net>
Subject Re: Is there a way to tell when iterating in #foreach if you have com e to the last element.
Date Sun, 08 Sep 2002 16:21:50 GMT
On 9/6/02 12:12 PM, "Joshua.Levy@reasoning.com" <Joshua.Levy@reasoning.com>
wrote:

>> Maybe the velocity team can plug in a
>> $hasNext = true|false
>> as it already maintains a loop $velocityCount variable.
> 
> If you do this, then I vote for $velocityHasNext or something
> else which minimizes the namespace confusion.  With velocity,
> you are already dealing with the Java namespace, and the
> velocity macro/variable namespace.  It would be nice if all
> the velocity created variables had related names.
> 

The string 'velocityCount' is actually configurable.  I'm not sure that in
itself was a good thing, but it does give you the freedom to change it.  The
downside, of course, is that if you do change it for your template, it will
be unreadable for people who don't know you are changing the loop var name
behind the scenes.

-- 
Geir Magnusson Jr. 
Research & Development, Adeptra Inc.
geirm@adeptra.com
+1-203-247-1713



--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message