As you debug, the
Watch window displays the values of variables and expressions.
To display the window, click
Debug > Windows > Watch > Watch
n while debugging.
Use the
Watch window to:
- View the value of variables using one of these methods to add a variable to the
Watch window:
- Right-click a variable in the editor and click
Add Watch.
- In the
Watch window, click an empty row in the
Name column, and type a variable.
- View the value of expressions by clicking an empty row in the
Name column, and typing an expression.
- Change the display format for all values from decimal to hexadecimal by right-clicking in the
Watch window, and then clicking
Hexadecimal Display.
- Change the display format of values on an individual row:
- Select a row.
- Press
F2.
- Type a modifier after the name of the variable or the expression as follows:
- h or x
- Type
Variable,h or
Variable,x to always display the variable or the expression in hexadecimal format.
- d
- Type
Variable,d to always display numeric variables in decimal format and strings - as text.