velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob.mcl...@verizon.com
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 :)

Rob


                                                                                         
                                
                      "Andrew Tetlaw"                                                    
                                
                      <andrew_tetlaw@bv        To:       "Velocity Users List" <velocity-user@jakarta.apache.org>
        
                      n.com.au>                cc:                                    
                                   
                                               Subject:  Re: problem with #foreach       
                                
                      05/07/03 04:41 PM                                                  
                                
                      Please respond to                                                  
                                
                      "Velocity Users                                                    
                                
                      List"                                                              
                                
                                                                                         
                                
                                                                                         
                                




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

Cheers,
Andrew Tetlaw

Bligh Voller Nield
http://www.bvn.com.au
p: (07) 3251 5778
f: (07) 3852 2544

rob.mclain@verizon.com wrote on 08/05/2003 04:16:00 AM:

>
> Terry,
>
> You are right about the syntax.  I actually calculated $foo.size() -1
and
> 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">
<b>

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


Mime
View raw message