velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@optonline.net>
Subject Re: Range operator
Date Wed, 07 Mar 2001 11:24:16 GMT
À⵿̱ wrote:

> I have a question about range operator.
> This code is working
> 
>     #foreach ($i in [1..10])
>       $i
>     #end
> 
> But, that code is not working
> 
>     #foreach ($i in [1..$var])
>       $i
>     #end
> 
> and I set $var to 10.


The following example works :

#set($var = 10)

#foreach($i in [1..$var])
$i
#end

(I just tried it :)

Take a look at your template again to make sure that all is well - if
you still have a problem, send us your tempalate so we can take a look.

geir

-- 
Geir Magnusson Jr.                               geirm@optonline.com
Developing for the web?  See http://jakarta.apache.org/velocity/

Mime
View raw message