velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Christian <si...@cpd.co.uk>
Subject Re: mod function?
Date Wed, 11 Sep 2002 08:31:10 GMT
Hi Phillip,

There is a mod operator built in:

#foreach( $letter in ["a","b","c","d","e","f","g","h","i","j"] )
#if( $velocityCount % 3 == 0 )$letter #end
#end

Note the $velocityCount variable *may* have been renamed in your 
configuration.

HTH

- simon

phillip rhodes wrote:
> Hi.
> When I looping through with a #foreach
> I would like to print out some content every 3rd iteration.
> 
> While I can do this using variables, etc, I was wondering if there is a velocity elegant
way to do this.
> Thanks.
> 


--
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