ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: nested conditions?
Date Fri, 13 Sep 2002 17:40:12 GMT
It looks like elementary logic problems.  You seem to
have

(!(x == 0) && !(y == 0)) //neither is zero

when what you need is

(!(x == 0) || !(y == 0)) //"either is nonzero"

or

!(x == 0 && y == 0) //"not both are zero"

-Matt

--- otisg <otisg@ureach.com> wrote:
> Hello,
> 
> I'm trying to get this to work, but it
> doesn't looks like it's working.  I'm using
> Ant 1.5.
> 
>         <echo>
>             Error Codes: ${retValSeg1},
> ${retValSeg2}.
>         </echo>
>         <condition property="hasError>
>             <and>
>                 <not>
>                     <equals
> arg1="${retValSeg1}" arg2="0"/>
>                 </not>
>                 <not>
>                     <equals
> arg1="${retValSeg2}" arg2="0"/>
>                 </not>
>             </and>
>         </condition>
> 
> I am simply trying to say:
> If retValSeg1 is NOT zero AND retValSeg2 is
> NOT zero, set hasError property.
> 
> According to the Ant Manual and description
> of 'and', this should work.
> The echo shows that the codes are non-zero.
> That is, the retValSeg1 IS zero, but
> retValSeg2 is 8.
> 
> What am I doing wrong?  How should I rewrite
> this?
> 
> Thanks,
> Otis
> 
> 
> 
> ________________________________________________
> Get your own "800" number
> Voicemail, fax, email, and a lot more
> http://www.ureach.com/reg/tag
> 
> --
> To unsubscribe, e-mail:  
> <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:ant-user-help@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message