Forums

Full Version: Difference between setContext and Var?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Both setContext and Var use to assign value to a variable. But if we are using Var, we can not use the Variable outside the particular scripting area(Component/Connection). At the same time, setContext can be used anywhere in the Dashboard.
 
Ie, if we are setting a context in Dashboard script, we can utilize the assigned value in any other component or connection scripting area using getContext.
 
Eg:
sdk.setContext( 'age_val', 1 );         --> In dashboard Script
var a = sdk.getContext( 'age_val' ); -->In component Script