# Updating macros

**URL:** https://www.finalbuilder.com/forums/t/updating-macros/3785
**Category:** Feature Requests
**Created:** [December 1, 2006, 3:12am UTC](https://www.finalbuilder.com/forums/t/updating-macros/3785 "2006-12-01T03:12:37Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![stevage](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@stevage](https://www.finalbuilder.com/forums/u/stevage)
#### Post date: [December 1, 2006, 3:12am UTC](https://www.finalbuilder.com/forums/t/updating-macros/3785/1 "2006-12-01T03:12:37Z")

</div>

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

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [December 4, 2006, 11:28am UTC](https://www.finalbuilder.com/forums/t/updating-macros/3785/2 "2006-12-04T11:28:18Z")

</div>

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%

---

<div class="post-metadata">

### Author: ![stevage](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@stevage](https://www.finalbuilder.com/forums/u/stevage)
#### Post date: [December 5, 2006, 11:52am UTC](https://www.finalbuilder.com/forums/t/updating-macros/3785/3 "2006-12-05T11:52:13Z")

</div>

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

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [December 6, 2006, 4:07am UTC](https://www.finalbuilder.com/forums/t/updating-macros/3785/4 "2006-12-06T04:07:39Z")

</div>

No difference. What would expect a persistent macro to do, anyhow?

---

<div class="post-metadata">

### Author: ![stevage](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@stevage](https://www.finalbuilder.com/forums/u/stevage)
#### Post date: [December 6, 2006, 4:20am UTC](https://www.finalbuilder.com/forums/t/updating-macros/3785/5 "2006-12-06T04:20:08Z")

</div>

Nothing, but since the option is there, you wonder 🙂 Maybe you could grey out combinations that don’t make sense?  
  
Steve
