Do you mean that :    #if($foo==null)  can work.

I have try this several weeks ago, and I think it is not supported,  right?


Regards

fanyun



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Geir Magnusson Jr.
Sent: Thursday, December 28, 2000 11:30 PM
To: Turbine
Subject: Re: $variable in .vm?


> lvjin wrote:
>
> Hi,
> Can I determine if a $variable has been set in .vm files
>
> lvjin

You can test it with #if() :

#if( $foo )
  \$foo is set
#else
  \$foo is not set
#end

The only problem is that if $foo is boolean and false, you will get a
misleading answer.

(Hmmm.  Maybe something like #if( $foo == null ) would be useful here...
)

geir

--
Geir Magnusson Jr.                               [EMAIL PROTECTED]
Velocity : it's not just a good idea. It should be the law.
http://jakarta.apache.org/velocity


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]




------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to