You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Phillip Rhodes <rh...@telerama.com> on 2003/01/10 07:58:00 UTC

if NOT help

I have a template that I am trying to get to work && it's 1:30 am.

I have a variable that will equal a character (i.e. "a")
If the variable is NOT zero length string (i.e. ""), I want to output 
something.

Even though I output the variable's value and display it, I can not get the 
if !(

#set($a = $b)
a is $a
## I always is "a is test" when the template is run from the above line
##  this is an if statement with a NOT operator
#if (!$a == "")
	I never see this, although a is not an empty string
#else
	I always see this, BUT i don't want to.  a is not an empty string
#end

I am seeing the same behavior in 1.2 and 1.3 velocity
Thanks!


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: if NOT help

Posted by Peter Romianowski <me...@gmx.de>.
what about #if ($a != "") ?

> -----Original Message-----
> From: Phillip Rhodes [mailto:rhodespc@telerama.com] 
> Sent: Friday, January 10, 2003 7:58 AM
> To: velocity-user@jakarta.apache.org
> Subject: if NOT help
> 
> 
> I have a template that I am trying to get to work && it's 1:30 am.
> 
> I have a variable that will equal a character (i.e. "a")
> If the variable is NOT zero length string (i.e. ""), I want to output 
> something.
> 
> Even though I output the variable's value and display it, I 
> can not get the 
> if !(
> 
> #set($a = $b)
> a is $a
> ## I always is "a is test" when the template is run from the 
> above line
> ##  this is an if statement with a NOT operator
> #if (!$a == "")
> 	I never see this, although a is not an empty string
> #else
> 	I always see this, BUT i don't want to.  a is not an 
> empty string
> #end
> 
> I am seeing the same behavior in 1.2 and 1.3 velocity
> Thanks!
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:velocity-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>