This is Nant or Ant? If this is Ant, you'd do it this way:
<if>
<equals arg1="${var}" arg2=""/>
<then>
<echo>blah, blah, blah</echo>
</then>
<else> <!-- OPTIONAL-->
<echo>Yadda, Yadda, Yadda</echo>
</else>
</if>
If you want to do not equals, you do this:
<if>
<not>
<equals arg1="${var}" arg2=""/>
</not>
<then>
<echo message="Blah, blah, blah"/>
</then>
<if>
Take a look at the <condition> task's conditions at
<http://ant.apache.org/manual/CoreTasks/conditions.html>
--
David Weintraub
[EMAIL PROTECTED]
On Sun, Jun 29, 2008 at 5:19 AM, Guy Catz <[EMAIL PROTECTED]> wrote:
> How can I tell if a property is defined?
>
> I've tried <if> from contrib like this - if .. ${var} = "" ...
> That's fine for properties which was set to "", but not for properties who
> haven't set at all.
>
> Next, I've tried <length string="${var}" property="length.var"...
> and then <if> ${length.var}="0", but I always get length.var = 6 because it
> didn't open the ${var}, which is 6 chars.
>
> Please advise.
>
> Thanks,
> Guy.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]