velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Magnusson Jr. <ge...@adeptra.com>
Subject Re: Setting Variables
Date Wed, 27 Nov 2002 16:42:34 GMT

On Tuesday, November 26, 2002, at 07:13 PM, Peter Harrison wrote:

> Have a interesting problem:
>
> If I do something like :
>
> #set( $foo = $bar / 52 )
> $foo
>
> where $bar is some Float set in the context (say 52), then I get
> $foo - ie it isn't replaced.
>
> However, if I do this:
>
> #set( $foo = 0 )
> #set( $foo = $bar /52 )
> $foo
>
> Then the result is:
> 1
>
> Which is correct. Question is why do I need to set $foo to zero before 
> doing
> the second set for it to work?
>

First, right now the vel you are using doesn't support floats.  It will 
soon on a test basis :)

I'm actually surprised that you get a value of 1, rather than 0 in the 
output.  Are you sure?
-- 
Geir Magnusson Jr                                   203-355-2219(w)
Adeptra, Inc.                                       203-247-1713(m)
geirm@adeptra.com


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


Mime
View raw message