Variable Scope / Publicity and Privacy
Posted: Fri Sep 12, 2008 6:56 pm
hi,
i notice the following behavior: when a Variable is defined in OnSpawn of any Model other than ZApplication, i can use this variable in a ZExpression in a different model without any displayed errors - but it is always treated like 0, indifferent of the actual value. if i then try to address it like 'Model.Variable.Value', there is an error saying that the variable cannot be found. if the variable definition is located in ZApplication\OnLoaded, everything works just fine.
what is the policy/scope of variables defined in models other than ZApp.? are they always only visible inside their own model? what would be the smartest way of 'communicating' between models other than 'global' variables?
i notice the following behavior: when a Variable is defined in OnSpawn of any Model other than ZApplication, i can use this variable in a ZExpression in a different model without any displayed errors - but it is always treated like 0, indifferent of the actual value. if i then try to address it like 'Model.Variable.Value', there is an error saying that the variable cannot be found. if the variable definition is located in ZApplication\OnLoaded, everything works just fine.
what is the policy/scope of variables defined in models other than ZApp.? are they always only visible inside their own model? what would be the smartest way of 'communicating' between models other than 'global' variables?