velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: problem with #foreach
Date Wed, 07 May 2003 20:56:21 GMT

Thanks Andrew.  I am rewriting the code to iterate over the list, which
will work in every case.  Being that there was no way to say ascending or
descending, it does what I told it to do,  not what I meant :)


                      "Andrew Tetlaw"                                                    
                      <andrew_tetlaw@bv        To:       "Velocity Users List" <>
            >                cc:                                    
                                               Subject:  Re: problem with #foreach       
                      05/07/03 04:41 PM                                                  
                      Please respond to                                                  
                      "Velocity Users                                                    

>From the user guide:

"Whether m is greater than or less than n will not matter; in this case
the range will simply count down."

Andrew Tetlaw

Bligh Voller Nield
p: (07) 3251 5778
f: (07) 3852 2544 wrote on 08/05/2003 04:16:00 AM:

> Terry,
> You are right about the syntax.  I actually calculated $foo.size() -1
> assigned it to a variable.  But try this:
> #foreach ($i in [ 0 .. -1] )
>       $i
> #end
> The output:
>       0 -1
> Rob

<font face="Arial, Helvetica, sans-serif" size="2">

Please Also Note
</b>This document, including attachments, is only intended for the
addressees and may contain privileged or confidential information.
Unauthorised use, copying or distribution of the document or any part of
its contents, is prohibited. If you receive this Email in error please
notify us by return Email or telephone. We will reimburse you for any
reasonable expenses incurred in meeting this request.</font>

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

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

View raw message