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: Integers and numbers in a comparison expression
Date Sat, 14 Jul 2001 02:00:29 GMT
Tal Dayan wrote:
> 
> If a template has a numeric comparison such as
> 
> #if ($num > 7)
> 
> Does $num have to be an Integer or can it also be a Long or even a String ?

Just an integer.  Working out a way to do Longs nicely, and forget about
strings... :)

> 
> What about the case where $num did not come externaly from the application
> Java code
> but from the template itself as in
> 
> #set $num = 3

Ahem.

#set($num = 3)
 
> Will the numeric comparison still work ok ?

Yes - that's an Integer.
 
> What about
> 
> #set $num = "3" ?

#set( $num = "3")  or #set($num = '3')

no, that's a string.
 
> Thanks,
> 
> Tal

geir

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!

Mime
View raw message