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:

  1. Expand the thread in the Locals pane where the local variable you want to view appears.
  2. If necessary, use the scroll bars or PageUp and PageDown keys to scroll the pane until the variable is visible.
  3. If your variable is a class, struct or array, it can be expanded to show its individual elements.
  4. If desired, change the representation of the variable: right-click on the variable and select a representation from the Monitor Representation menu.

To view the contents of a variable or expression you have already added to the Monitors pane:

  1. Use the scroll bars or PageUp and PageDown keys to scroll the pane until the variable is visible.
  2. If your variable is a class, struct or array, it can be expanded to show its individual elements.
  3. If desired, change the representation of the variable: right-click on the variable and select a representation from the Monitor Representation menu.

If a variable or expression is not in scope, a message displays in the Monitors pane instead of a value.

ngjava.gif (225 bytes)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 hover help. To enable hover help, see the related topic below.

Related Tasks
Enabling hover help for variables
Adding a variable or expression to the Monitors pane
Viewing a location in storage