NOTE: The generic term nonstatic variable is used here to denote what
is called an automatic variable in some languages.
The technique for accessing a variable varies according to whether it
is a static or nonstatic variable.
The system differentiates between static and nonstatic variables by
determining how they are stored.
A static variable is associated with the same memory address throughout
execution of the program. You can always access a static variable.
A nonstatic variable is allocated on the stack or in a register and has
a value only when its defining routine or block is active. Therefore,
you can access a nonstatic variable only when program execution is
paused within the scope of its defining routine or block (which
includes any routine called by the defining routine).
A common technique for accessing a nonstatic variable is first to set a
breakpoint on the defining routine and then to execute the program to
the breakpoint.
Whenever the execution of your program makes a nonstatic variable
inaccessible, the debugger notifies you as follows:
- If you try to display the value of the variable or monitor the
variable, the debugger issues a message that the variable is not
active or not in scope.
- If the variable is currently being monitored, its entry becomes
dimmed in the monitor view. When the entry is dimmed, the debugger
does not check or update the variable's displayed value; also, you
cannot change that value. The entry is fully displayed whenever
the variable becomes accessible again.