Viewing the contents of a variable or
expression
You can view the contents of a variable or expression in the Locals pane or the
Monitors pane, if you have added the variable there. By default, all local variables in
scope are added to the Locals pane.
To view the contents of a variable or expression in the Locals pane:
- Expand the thread in the Locals pane where the local variable you want to view appears.
- If necessary, use the scroll bars to scroll the pane until
the variable is visible.
- If your variable is a class, struct or array, it can be expanded to show its individual
elements.
- If desired, change the representation of the variable: right-click on the
variable and select Representation
from the pop-up menu. Then select the desired representation from the Monitor
Representation dialog box.
To view the contents of a
variable or expression you have already added to the Monitors pane:
- Use the scroll bars to scroll the pane until the variable is
visible.
- If your variable is a class, struct or array, it can be expanded to show its individual
elements.
- If desired, change the representation of the variable: right-click on the
variable and select Representation
from the pop-up menu. Then select the desired representation from the Monitor
Representation dialog box.
If a variable or expression is not in scope, a
message displays in the Monitors pane instead of a value.
Important:
After exiting a program block, variables out of scope may still be shown in the Locals or
Monitors panes.
You can also view the contents of variables in the Source pane with Tool-tip
evaluation. To
enable Tool-tip evaluation, see the related topic below.

Enabling Tool-tip evaluation for variables
Adding a variable or expression to the Monitors pane
Viewing a location in storage