I have a variable macro that defines the build directory: %BuildHome%%BuildID%When I find out more information about the build, I want to update the macro to be: %BuildHome%%VersionBuildNumber%_%BuildID%It doesn’t seem to be possible to redefine macros at runtime, however.Steve
It says in the documentation that you can’t change a macro at runtime.
Could you just use an intermediate variable? Like so:
Build to %BuildHome%%BuildIDx%
At the beginning of your script, set BuildIDx=%BuildID%
Then later set BuildIDx=%VersionBuildNumber%_%BuildID%
Or use a variable to hold the underscore until you get a build number:
Build to %BuildHome%%VersionBuildNumber%%UnderScore%%BuildID%
now if VersionBuildNumber and Underscore are blank, this will still evaluate to the same thing as %BuildHome%%BuildID%
Yes, in practice that’s basically what I’m doing.
I wonder if there is a difference between a persistent and non-persistent macro? The combination of environment variable with persistent doesn’t work, so I wonder if other combinations of these flags don’t…
Steve
No difference. What would expect a persistent macro to do, anyhow?
Nothing, but since the option is there, you wonder Maybe you could grey out combinations that don’t make sense?
Steve