Hi, Daniell....
 
In this case I had already set the value of index, and needed to increment it to save in index.1.
 
<property name="index.1" value="${int::parse(index) + 1}"/>
 
And another:
<property name="version.2"  value="${string::substring(build.number, int::parse(index.1),int::parse(length.1))}"/>
 
Rod
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Daniell, Casey B
Sent: Monday, April 10, 2006 12:52 PM
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] Increment number

Ok,
 
How do I increment the value of a property by one (1) in a nant script.
 
 
I want to read a file, get a value from that file (its sets a property), then increment it by one for future use.
 
I have tried:
 
  <!-- Get last build number Used -->
    <xmlpeek file="c:/archive/foo.xml"
             xpath="/IntegrationResult/Label"
             property="last.build"/>
             
  <property name="this.build" value="${last.build} + 1"/>
 
OUTPUT== [echo] THIS BUILD TAG IS 75 + 1
 
Basically, I know I need to dereference the property add the integer 1 to it, then save it to the new value. How do I go about doing this?
 
Casey

Reply via email to