You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by coonay <co...@yahoo.com> on 2009/05/07 10:58:49 UTC

Comparison length for processing as a condition

i want to test if a string is longer than a number,in the build.xml file:

  <condition property="isValidHost">
     <length  string="${HOST}" when="gt" length="100" />
  </condition>


  isValidHost is always not set when the ant runing,what's the problem ?

  is there any other way i can get it done?thanks so much
-- 
View this message in context: http://www.nabble.com/Comparison-length-for-processing-as-a-condition-tp23422758p23422758.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: AW: AW: Comparison length for processing as a condition

Posted by coonay <co...@yahoo.com>.
Hi,Jan

many thanks for you help

Jan.Materne wrote:
> 
> Again:
> Where do you set ${HOST}?
> Have you checked its value?
> 
> 
> I tried an example and it works for me.
> 
> 
> Jan
> 
> 
> <project>
> 
>   <condition property="isValidHost">
>       <length  string="${HOST}" when="gt" length="10" />
>   </condition>
>   <echo>HOST    : ${HOST}</echo>
>   <echo>isValid : ${isValidHost}</echo>
> 
>   <property name="HOST" value="thisIsALongHostName"/>
>   <condition property="isValidHost">
>       <length  string="${HOST}" when="gt" length="10" />
>   </condition>
>   <echo>HOST    : ${HOST}</echo>
>   <echo>isValid : ${isValidHost}</echo>
> 
> </project>
> 
> 
>>-----Ursprüngliche Nachricht-----
>>Von: coonay [mailto:coonay@yahoo.com] 
>>Gesendet: Freitag, 8. Mai 2009 07:36
>>An: user@ant.apache.org
>>Betreff: Re: AW: Comparison length for processing as a condition
>>
>>
>>the answer is that isValidHost is not set if    len of ${HOST} 
>>is not gt
>>>100.
>>i suppose ant should set it to false,but it doesn't 
>>
>>
>><condition property="isValidHost">
>>     <length  string="${HOST}" when="gt" length="100" />
>> </condition>
>>
>>
>>
>>
>>
>>
>>Jan.Materne wrote:
>>> 
>>> Where do you set ${HOST}?
>>> Have you checked its value?
>>> 
>>> Jan 
>>> 
>>>>-----Ursprüngliche Nachricht-----
>>>>Von: coonay [mailto:coonay@yahoo.com] 
>>>>Gesendet: Donnerstag, 7. Mai 2009 10:59
>>>>An: user@ant.apache.org
>>>>Betreff: Comparison length for processing as a condition
>>>>
>>>>
>>>>i want to test if a string is longer than a number,in the 
>>>>build.xml file:
>>>>
>>>>  <condition property="isValidHost">
>>>>     <length  string="${HOST}" when="gt" length="100" />
>>>>  </condition>
>>>>
>>>>
>>>>  isValidHost is always not set when the ant runing,what's the 
>>>>problem ?
>>>>
>>>>  is there any other way i can get it done?thanks so much
>>>>-- 
>>>>View this message in context: 
>>>>http://www.nabble.com/Comparison-length-for-processing-as-a-con
>>>>dition-tp23422758p23422758.html
>>>>Sent from the Ant - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>>>For additional commands, e-mail: user-help@ant.apache.org
>>>>
>>>>
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: user-help@ant.apache.org
>>> 
>>> 
>>> 
>>
>>
>>-----
>>http://coonay2010expo.blogspot.com/ http:coonay 
>>-- 
>>View this message in context: 
>>http://www.nabble.com/Comparison-length-for-processing-as-a-con
>>dition-tp23422758p23440392.html
>>Sent from the Ant - Users mailing list archive at Nabble.com.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>For additional commands, e-mail: user-help@ant.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 


-----
http://coonay2010expo.blogspot.com/ http:coonay 
-- 
View this message in context: http://www.nabble.com/Comparison-length-for-processing-as-a-condition-tp23422758p23442888.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


AW: AW: Comparison length for processing as a condition

Posted by Ja...@rzf.fin-nrw.de.
Again:
Where do you set ${HOST}?
Have you checked its value?


I tried an example and it works for me.


Jan


<project>

  <condition property="isValidHost">
      <length  string="${HOST}" when="gt" length="10" />
  </condition>
  <echo>HOST    : ${HOST}</echo>
  <echo>isValid : ${isValidHost}</echo>

  <property name="HOST" value="thisIsALongHostName"/>
  <condition property="isValidHost">
      <length  string="${HOST}" when="gt" length="10" />
  </condition>
  <echo>HOST    : ${HOST}</echo>
  <echo>isValid : ${isValidHost}</echo>

</project>


>-----Ursprüngliche Nachricht-----
>Von: coonay [mailto:coonay@yahoo.com] 
>Gesendet: Freitag, 8. Mai 2009 07:36
>An: user@ant.apache.org
>Betreff: Re: AW: Comparison length for processing as a condition
>
>
>the answer is that isValidHost is not set if    len of ${HOST} 
>is not gt
>>100.
>i suppose ant should set it to false,but it doesn't 
>
>
><condition property="isValidHost">
>     <length  string="${HOST}" when="gt" length="100" />
> </condition>
>
>
>
>
>
>
>Jan.Materne wrote:
>> 
>> Where do you set ${HOST}?
>> Have you checked its value?
>> 
>> Jan 
>> 
>>>-----Ursprüngliche Nachricht-----
>>>Von: coonay [mailto:coonay@yahoo.com] 
>>>Gesendet: Donnerstag, 7. Mai 2009 10:59
>>>An: user@ant.apache.org
>>>Betreff: Comparison length for processing as a condition
>>>
>>>
>>>i want to test if a string is longer than a number,in the 
>>>build.xml file:
>>>
>>>  <condition property="isValidHost">
>>>     <length  string="${HOST}" when="gt" length="100" />
>>>  </condition>
>>>
>>>
>>>  isValidHost is always not set when the ant runing,what's the 
>>>problem ?
>>>
>>>  is there any other way i can get it done?thanks so much
>>>-- 
>>>View this message in context: 
>>>http://www.nabble.com/Comparison-length-for-processing-as-a-con
>>>dition-tp23422758p23422758.html
>>>Sent from the Ant - Users mailing list archive at Nabble.com.
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>>For additional commands, e-mail: user-help@ant.apache.org
>>>
>>>
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>> 
>> 
>> 
>
>
>-----
>http://coonay2010expo.blogspot.com/ http:coonay 
>-- 
>View this message in context: 
>http://www.nabble.com/Comparison-length-for-processing-as-a-con
>dition-tp23422758p23440392.html
>Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>

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


Re: AW: Comparison length for processing as a condition

Posted by coonay <co...@yahoo.com>.
the answer is that isValidHost is not set if    len of ${HOST} is not gt
>100.
i suppose ant should set it to false,but it doesn't 


<condition property="isValidHost">
     <length  string="${HOST}" when="gt" length="100" />
 </condition>






Jan.Materne wrote:
> 
> Where do you set ${HOST}?
> Have you checked its value?
> 
> Jan 
> 
>>-----Ursprüngliche Nachricht-----
>>Von: coonay [mailto:coonay@yahoo.com] 
>>Gesendet: Donnerstag, 7. Mai 2009 10:59
>>An: user@ant.apache.org
>>Betreff: Comparison length for processing as a condition
>>
>>
>>i want to test if a string is longer than a number,in the 
>>build.xml file:
>>
>>  <condition property="isValidHost">
>>     <length  string="${HOST}" when="gt" length="100" />
>>  </condition>
>>
>>
>>  isValidHost is always not set when the ant runing,what's the 
>>problem ?
>>
>>  is there any other way i can get it done?thanks so much
>>-- 
>>View this message in context: 
>>http://www.nabble.com/Comparison-length-for-processing-as-a-con
>>dition-tp23422758p23422758.html
>>Sent from the Ant - Users mailing list archive at Nabble.com.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>For additional commands, e-mail: user-help@ant.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 


-----
http://coonay2010expo.blogspot.com/ http:coonay 
-- 
View this message in context: http://www.nabble.com/Comparison-length-for-processing-as-a-condition-tp23422758p23440392.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


AW: Comparison length for processing as a condition

Posted by Ja...@rzf.fin-nrw.de.
Where do you set ${HOST}?
Have you checked its value?

Jan 

>-----Ursprüngliche Nachricht-----
>Von: coonay [mailto:coonay@yahoo.com] 
>Gesendet: Donnerstag, 7. Mai 2009 10:59
>An: user@ant.apache.org
>Betreff: Comparison length for processing as a condition
>
>
>i want to test if a string is longer than a number,in the 
>build.xml file:
>
>  <condition property="isValidHost">
>     <length  string="${HOST}" when="gt" length="100" />
>  </condition>
>
>
>  isValidHost is always not set when the ant runing,what's the 
>problem ?
>
>  is there any other way i can get it done?thanks so much
>-- 
>View this message in context: 
>http://www.nabble.com/Comparison-length-for-processing-as-a-con
>dition-tp23422758p23422758.html
>Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>

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