Forum Discussion
tristaanogre
14 years agoEsteemed Contributor
Perhaps you can write code to initialize a temporary variable. For example, a Table type variable is a temporary type. The following code will create the variable "foo" and initialize it to a certain set of values.
And then, if you want the variable to be temporary, use Project.Variables.RemoveVariable to remove it from the project at the end of the run.
function blah()
{
if (!Project.Variables.VariableExists("foo"))
{
Project.Variables.AddVariable("foo", "Table")
}
Project.Variables.foo.AddColumn("Test1")
Project.Variables.foo.AddColumn("Test2")
Project.Variables.foo.RowCount = 5
var Index
for(Index=0;Index<5;Index++)
{
Project.Variables.foo.Item("Test1", Index) = "Row" + Index + "Test1"
Project.Variables.foo.Item("Test2", Index) = "Row" + Index + "Test1"
}
}
And then, if you want the variable to be temporary, use Project.Variables.RemoveVariable to remove it from the project at the end of the run.