# Define Variable Macro/Environment Property Cannot Be Changed

**URL:** https://www.finalbuilder.com/forums/t/define-variable-macro-environment-property-cannot-be-changed/3143
**Category:** Bugs
**Created:** [August 26, 2009, 3:39am UTC](https://www.finalbuilder.com/forums/t/define-variable-macro-environment-property-cannot-be-changed/3143 "2009-08-26T03:39:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![nelsonwolf](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/b9e5f3/32.png) [@nelsonwolf](https://www.finalbuilder.com/forums/u/nelsonwolf)
#### Post date: [August 26, 2009, 3:39am UTC](https://www.finalbuilder.com/forums/t/define-variable-macro-environment-property-cannot-be-changed/3143/1 "2009-08-26T03:39:52Z")

</div>

I am unable to use Define Variable to define 1 dynamic variable with Macro = True and one with Macro = False. The key here is using a variable in the variable name.   
  
 In actual use I read in an xml file and based on input data, I change the behavior of Define Variable to create Macro = True/False and/or EnvironmentVariable = True/False. It seems to take on whatever the first variables properties are set to.   
  
 I am attaching an example. In the first group I use the BeforeScript to set the variables, in the second group I use 4 if statements which correspond to a different Define Variable action that should set the correct paramters. After running the project I look at the Runtime Defined variables and they all have Macro = True and EnvironmentVariable = True.   
  
 Regards,   
 -Nelson[DefineVariableBug.zip](https://www.finalbuilder.com/forums/uploads/default/original/2X/f/fac09dd56f43ecf4e4cede5f60642f4e0a5ee4cb.zip) (3.926 KB)

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [August 27, 2009, 6:11am UTC](https://www.finalbuilder.com/forums/t/define-variable-macro-environment-property-cannot-be-changed/3143/2 "2009-08-27T06:11:26Z")

</div>

Errr... might want to take a look at your BeforeAction script :   
  
if (String(DynVarIsEnv).toLowerCase() == "true")   
{   
Action.EnvironmentVariable = true;   
Action.SendLogMessage("EnvironmentVariable: true");   
} else {   
Action.EnvironmentVariable = **true** ; //Should be false!!!!   
Action.SendLogMessage("EnvironmentVariable: false");   
}

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [August 27, 2009, 6:20am UTC](https://www.finalbuilder.com/forums/t/define-variable-macro-environment-property-cannot-be-changed/3143/3 "2009-08-27T06:20:36Z")

</div>

BTW, I really dislike the Define Variable Action, I’ve yet to find a real use for it that couldn’t done with regular variables. It’s something I regret allowing to be included (I didn’t write it) as we get a lot of support requests that turn out to spurious use of this action.

---

<div class="post-metadata">

### Author: ![nelsonwolf](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/b9e5f3/32.png) [@nelsonwolf](https://www.finalbuilder.com/forums/u/nelsonwolf)
#### Post date: [August 27, 2009, 6:47am UTC](https://www.finalbuilder.com/forums/t/define-variable-macro-environment-property-cannot-be-changed/3143/4 "2009-08-27T06:47:07Z")

</div>

Thanks Vincent, I swear that line must have just changed itself
