counting in velocity

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

counting in velocity

Dressler, Erik(externe MA)

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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: counting in velocity

Mike C
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:[hidden email]]
> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: counting in velocity

Will Glass-Husain
In reply to this post by Dressler, Erik(externe MA)
#foreach($i in [1..10])

#end

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

#foreach($i in $range)

#end

WILL

----- Original Message -----
From: "Dressler, Erik(externe MA)" <[hidden email]>
To: "'Velocity Users List'" <[hidden email]>
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: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: counting in velocity

Dimitris Kolovos-2
In reply to this post by Dressler, Erik(externe MA)
#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: [hidden email]
>For additional commands, e-mail: [hidden email]
>
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: counting in velocity

Shinobu Kawai
In reply to this post by Dressler, Erik(externe MA)
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 <[hidden email]>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: counting in velocity

jian chen
In reply to this post by Dressler, Erik(externe MA)
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) <[hidden email]> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: counting in velocity

Malcolm Edgar
In reply to this post by Dressler, Erik(externe MA)
There is a $velocityCount variable you can use in a loop

"The default name for the loop counter variable reference, which is
specified in the velocity.properties file, is $velocityCount. By default
the counter starts at 1, but this can be set to either 0 or 1 in the
velocity.properties file. Here's what the loop counter properties
section of the velocity.properties  file appears:

# Default name of the loop counter
# variable refernce.
counter.name = velocityCount

# Default starting value of the loop
# counter variable reference.
counter.initial.value = 1"

-----Original Message-----
From: Dressler, Erik(externe MA) [mailto:[hidden email]]
Sent: Tuesday, 17 May 2005 6:00 PM
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: [hidden email]
For additional commands, e-mail: [hidden email]



NOTICE
This e-mail and any attachments are confidential and may contain copyright material of Macquarie Bank or third parties. If you are not the intended recipient of this email you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. Macquarie Bank does not guarantee the integrity of any emails or any attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of Macquarie Bank.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]