Merrill Cornish wrote:
It all started out innocently enough with me trying to conditionalize an <echo> 
message depending on whether the size of a certain file was greater or less than a certain 
limit.  Things when down hill from there.  Below is a simplified NAnt script and the output 
it produced.

To my understanding the third message should have printed as "expr2=True" similar to 
how the second message printed.

Merrill
======================================================

<?xml version="1.0" ?>
<project name="Test" default="run" >
        <target name="run" >
                <property name="count" value="100" />
                <echo message="count=${count}" />
                <echo message="expr1=${50 &lt; 100}" />
                <echo message="expr2=${50 &lt; count}" />
        </target>
</project>
=====================================================
> [snip]
System.ArgumentException: Object must be of type Int32.

Merrill,

Implicit conversion has been removed from NAnt, and properties currently evaluate as strings... to get around this, you should change your expression to:

<echo message="expr2=${50 &lt; convert::to-int(count)}" />


Regards,

-- Troy


------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ Nant-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to