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,
-NelsonDefineVariableBug.zip (3.926 KB)
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");
}
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.
Thanks Vincent, I swear that line must have just changed itself