Variables are only visible within the block where they are declared, for example when they are declared inside a function, they can be only seen within their function. If they are declared within an if...then block, they cannot be seen elsewhere, i.e. they have a limited scope.
The variables in the two functions cannot "see" each other. So in the function Print_more_information_to_BrainVoyagerLogtab()it is not possible to use the variable experimentname that was declared in the function Print_information_to_BrainVoyagerLogtab().
However, when a variable is declared in the same script, it is possible to use the variable in both functions (see figure below).
It is also possible to declare variables within a class. This means, that whenever an new object of that class is created, these variables are automatically created as well. In the figure below is shown which member variables are defined for the class glmobject.
When creating a new instance of the glmobject, with the name glmobj, an initial value for the member variables can be provided with an initial value for the member variables (glmtype, sercorr, filetype, normtype and glmsuperarray). This is shown in the figure below with the comment 'creation of new object'.
Now the object glmobj can be used, the autocompletion feature of the BrainVoyager script editor will show the member variables (see 'member variables' in the figure above). These variables can only be set and asked via the object, they are not directly accessible for functions. For the purpose of external access the (class) member functions get_filetype() etc have been written.