logo       

Re: Setting Variables: msg#00207

jakarta.velocity.user

Subject: Re: Setting Variables


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@xxxxxxxxxxx


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise