velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <>
Subject Re: determining odd/even position in foreach loop
Date Mon, 21 Jun 2004 15:43:19 GMT
Jason St. Louis said:
> Is there a built in way of determining whether the current iteration you
> are on is even or odd in a foreach loop?

as Will said, we did discuss this some weeks back, and the result was the new
Alternator and AlternatorTool in VelocityTools (but not in a released version

those two classes are improvements on the old alternator support in Velocity:

but there's also nothing wrong with just using the modulus operator.  it's my
understanding that this problem space is the primary reason that Velocity
supports that operator.

Nathan Bubna

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

View raw message