You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Dressler, Erik(externe MA)" <Er...@Dresdner-Bank.lu> on 2005/05/17 10:00:21 UTC

counting in velocity

hello, everybody!

i'm trying to implement a counter in velocity. i have no idea how to do it:

in java i would use a for-loop.

for(int i = 1; i < 10; i++)
{
	....
}

this seems a very easy problem to me, isn't it?

greets, erik
 
*  *  *  *  *  *  D I S C L A I M E R  *  *  *  *  *  *  *
 
This message is confidential and intended for the named addressee(s) only.
If you are not the intended recipient, please contact the sender by E-Mail
return and then delete this message from your system. You should not copy
or use it or disclose its contents to any other person.
 
If any part of this message is illegible or if you suspect that the message
may have been intercepted or amended, please contact the sender.
Dresdner Bank Luxembourg S.A. cannot accept any responsibility for the
accuracy or completeness of this message without further investigation.
 


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


Re: counting in velocity

Posted by Will Glass-Husain <wg...@forio.com>.
#foreach($i in [1..10])

#end

or
#set($range = [1..10])

#foreach($i in $range)

#end

WILL

----- Original Message ----- 
From: "Dressler, Erik(externe MA)" <Er...@Dresdner-Bank.lu>
To: "'Velocity Users List'" <ve...@jakarta.apache.org>
Sent: Tuesday, May 17, 2005 1:00 AM
Subject: counting in velocity


>
> hello, everybody!
>
> i'm trying to implement a counter in velocity. i have no idea how to do 
> it:
>
> in java i would use a for-loop.
>
> for(int i = 1; i < 10; i++)
> {
> ....
> }
>
> this seems a very easy problem to me, isn't it?
>
> greets, erik
>
> *  *  *  *  *  *  D I S C L A I M E R  *  *  *  *  *  *  *
>
> This message is confidential and intended for the named addressee(s) only.
> If you are not the intended recipient, please contact the sender by E-Mail
> return and then delete this message from your system. You should not copy
> or use it or disclose its contents to any other person.
>
> If any part of this message is illegible or if you suspect that the 
> message
> may have been intercepted or amended, please contact the sender.
> Dresdner Bank Luxembourg S.A. cannot accept any responsibility for the
> accuracy or completeness of this message without further investigation.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 


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


Re: counting in velocity

Posted by jian chen <ch...@gmail.com>.
Not sure if I got your question completely. But can you use the the
$velocityCount variable?

Jian

On 5/17/05, Dressler, Erik(externe MA) <Er...@dresdner-bank.lu> wrote:
> 
> hello, everybody!
> 
> i'm trying to implement a counter in velocity. i have no idea how to do it:
> 
> in java i would use a for-loop.
> 
> for(int i = 1; i < 10; i++)
> {
>         ....
> }
> 
> this seems a very easy problem to me, isn't it?
> 
> greets, erik
> 
> *  *  *  *  *  *  D I S C L A I M E R  *  *  *  *  *  *  *
> 
> This message is confidential and intended for the named addressee(s) only.
> If you are not the intended recipient, please contact the sender by E-Mail
> return and then delete this message from your system. You should not copy
> or use it or disclose its contents to any other person.
> 
> If any part of this message is illegible or if you suspect that the message
> may have been intercepted or amended, please contact the sender.
> Dresdner Bank Luxembourg S.A. cannot accept any responsibility for the
> accuracy or completeness of this message without further investigation.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
>

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


Re: counting in velocity

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi erik,

> i'm trying to implement a counter in velocity. i have no idea how to do it:
> 
> in java i would use a for-loop.
> 
> for(int i = 1; i < 10; i++)
> {
>        ....
> }
> 
> this seems a very easy problem to me, isn't it?

Check out the Range Operator:
  http://jakarta.apache.org/velocity/user-guide.html#Range%20Operator

Best regards,
-- Shinobu

--
Shinobu Kawai <sh...@gmail.com>

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


Re: counting in velocity

Posted by Dimitrios Kolovos <ds...@gmail.com>.
#foreach($i in [0..10])
#end

Dressler, Erik(externe MA) wrote:

>hello, everybody!
>
>i'm trying to implement a counter in velocity. i have no idea how to do it:
>
>in java i would use a for-loop.
>
>for(int i = 1; i < 10; i++)
>{
>	....
>}
>
>this seems a very easy problem to me, isn't it?
>
>greets, erik
> 
>*  *  *  *  *  *  D I S C L A I M E R  *  *  *  *  *  *  *
> 
>This message is confidential and intended for the named addressee(s) only.
>If you are not the intended recipient, please contact the sender by E-Mail
>return and then delete this message from your system. You should not copy
>or use it or disclose its contents to any other person.
> 
>If any part of this message is illegible or if you suspect that the message
>may have been intercepted or amended, please contact the sender.
>Dresdner Bank Luxembourg S.A. cannot accept any responsibility for the
>accuracy or completeness of this message without further investigation.
> 
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
>  
>

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


RE: counting in velocity

Posted by GB Developer <gb...@globallyboundless.com>.
http://jakarta.apache.org/velocity/user-guide.html#Loops
or
http://jakarta.apache.org/velocity/user-guide.html#Range%20Operator


Mike C


> -----Original Message-----
> From: Dressler, Erik(externe MA) 
> [mailto:Erik.Dressler@Dresdner-Bank.lu] 
> Sent: Tuesday, May 17, 2005 3:00 AM
> To: 'Velocity Users List'
> Subject: counting in velocity
> 
> 
> 
> hello, everybody!
> 
> i'm trying to implement a counter in velocity. i have no idea 
> how to do it:
> 
> in java i would use a for-loop.
> 
> for(int i = 1; i < 10; i++)
> {
> 	....
> }
> 
> this seems a very easy problem to me, isn't it?
> 
> greets, erik
>  
> *  *  *  *  *  *  D I S C L A I M E R  *  *  *  *  *  *  *
>  
> This message is confidential and intended for the named 
> addressee(s) only. If you are not the intended recipient, 
> please contact the sender by E-Mail return and then delete 
> this message from your system. You should not copy or use it 
> or disclose its contents to any other person.
>  
> If any part of this message is illegible or if you suspect 
> that the message may have been intercepted or amended, please 
> contact the sender. Dresdner Bank Luxembourg S.A. cannot 
> accept any responsibility for the accuracy or completeness of 
> this message without further investigation.
>  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 


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