PDA

View Full Version : How can I increment a macro value?


David Hoffer
07-06-2005, 02:25 PM
I have a project macro (BUILD_VER) that I want to increment after every build. How can I do this?

I am trying to use the Macro action where I set its value. If I set its value to %BUILD_VER% +1 it changes the value to be "5 + 1". How can I make it evaluate the math first?

-dh

kinook
07-06-2005, 03:11 PM
Use a script expression (indicated by brackets):

[%BUILD_VER% + 1]

Also see the Increment Counter step in the Advanced.bld sample.

David Hoffer
07-06-2005, 03:19 PM
That works great!

Thanks.

-dh

teognost
11-10-2006, 01:31 PM
I need something similar-I have a macro %BUILD_VER% having the initial value 6.4.1010.0 (so it does not contain only numbers).
I need to update its value after every succesful build by incrementing the 3rd field (6.4.1010.0->6.4.1011.0).How can I do this?

kinook
11-10-2006, 04:56 PM
See attachment.

teognost
11-13-2006, 01:14 PM
thanks a lot,it works perfect!