Setting global variables
Posted: Wed 24. May 2017, 16:34
How do I set global variables in code? I can make one of a particular type, but not sure how to set its value
I've tried things like newVar = "Foo" and newVar.SetText("Foo"), but they don't work, and calling newVar[ObjectPropertyNames.DefaultValue] = "Foo" crashes Articy.
- Code: Select all
var testVarSet = Session.GetVariableSetByName("Test");
string newVarName = "Test_Blah";
var newVar = Session.CreateGlobalVariable(testVarSet, newVarName, VariableType.String);
I've tried things like newVar = "Foo" and newVar.SetText("Foo"), but they don't work, and calling newVar[ObjectPropertyNames.DefaultValue] = "Foo" crashes Articy.