The scopes( function returns the current scope of a variable, as well as any hidden scopes.


This function has one parameter:

variablename – name of the variable.


This function returns a carriage return delimited list of the scopes for which the current variable is defined. If the variable is not defined at all, the result will be empty. The first line of the result is the active scope for this variable. If there are hidden scopes (which are not normally accessible), they are listed on additional lines. This function is primarily useful for debugging situations where the same variable is defined more than once in different scopes, using this function can be helpful in figuring out what is going on inside Panorama.

In this example, two variables named x are defined. However, only the local variable is accessible, the fileglobal variable is hidden.

local x
fileglobal x
message scopes("x")

The message displayed by this code is:


Now suppose you create another procedure with this code:

message scopes("x")

The result will simply be fileglobal, since the local variable created in the first example no longer exists, but the fileglobal variable does still exist.

See Also


10.1NewNew in this version.