GLOBAL VARIABLE :HOW USE IT?
1 view (last 30 days)
Walter Roberson on 30 May 2023
Global variables are only reachable within the current workspace. Consider the following code:
first(); second(); third();
a = 'set by first';
a = 'set by second';
The result is not 'set by second' because for global variables, the connection between the name and the global variable is only made in workspaces that "opt in" to the connection by explicitly declaring the variable global.
Your function CaricaManageInstrument opts in to connecting "dd" to the global variable, but once you have returned to the base workspace (the command line), the base workspace has not opted into the connection between the name and the global variable.