I need to do a simple addition in NANT program like 1 + 1 =2. I am finding it difficult as every variable is taken as string by default in NANT. I have also tried using int::parse but it did not work.
Regards
Sarathy
I need to do a simple addition in NANT program like 1 + 1 =2. I am finding it difficult as every variable is taken as string by default in NANT. I have also tried using int::parse but it did not work.
Regards
Sarathy
Perhaps you can use convert::to-int. There's also an operator overview here.
I also found two examples that perhaps help to understand overall usage (example 1, example 2):
From example 1:
<if test=“${int::parse(UnitTestsResult) != 0}“>
<fail message=“Atleast one unit test failed!“/>
</if>
From example 2:
<target name="repeat">
<property name="var1" value="0" overwrite="false" />
<echo message="${var1}" />
<property name="var1" value="${convert::to-int(var1) + 1)" />
<call target="repeat" if="${convert::to-int(var1) < 10}" />
</target>