Contents
Keyword
Index
Using the WDB
GUI
Reference
Information
Troubleshooting
Using
Help |
|
|
The Quick Watch dialog box provides a way to quickly examine
the value of a variable or expression. You can calculate the current
value of a global variable, local variable, or variable not in the
current stack. You can also use Quick Watch to edit the value
of a variable or add a variable to the Watch view.
You can display a specified variable or expression in the Quick
Watch dialog box when your program is paused.
To view the value of a variable
- On the Debug menu, click Quick Watch.
- In the Expression text box, type the name of the variable
you want to calculate, or select one from the drop-down list of
variables entered during the current debug session.
- Click Recalculate. The value is displayed in the Current
Value area.
- To expand an expression, click the plus sign (+) to the left of
its name or double-click the line. To collapse an expression, click
the minus sign (-) or double-click the line.
- When you have finished, click Close.
See Tips for shortcuts to opening and using
Quick Watch.
When the program is paused at a breakpoint or between steps, you can
change the value of any variable in your program. This lets you try
changes and see their results in real time or recover from certain
logic errors.
To change a variable value in Quick Watch
- In the Quick Watch dialog box, click in the Expression
text box. Type the name of the variable you want to calculate, or
select one from the drop-down list of variables entered during the
current debug session.
- Click Recalculate. The value is displayed in the Current
Value area.
- Double-click the value you want to edit. A cursor appears in the
Value field.
- Edit the variable's value.
- Press Enter to update the program with the modified
variable value.
- When you have finished, click Close.
See Tips in the Quick Watch
Dialog Box reference topic for keyboard shortcuts.
NOTES:
- Press the Esc key to cancel the edit.
- Character string pointers--You cannot change the
content of the string, but you can change the address value
to point to a string at a different memory address.
- Character arrays -- You can edit the content of a
character array, but there is no safeguard to prevent you
from writing past the allocated array size. Also, the value
must be entered inside double quotes.
|
To monitor a specific variable, add it to the Watch view.
The Watch view displays the names and values of variables you
specify. You can watch global variables, local variables, or variables
not in the current stack.
To add a Quick Watch variable to the Watch view
- In the Quick Watch dialog box, click in the Expression
text box. Type the name of the variable you want to calculate, or
select one from the drop-down list of variables entered during the
current debug session.
- Click Add Watch.
- When you have finished, click Close.
- When you click Recalculate, the value of a variable is
highlighted in red if it has changed since the previous query.
- Click the
toolbar button to open the Quick Watch dialog box. If you
selected a variable name in the Source view, the variable is
entered in the Expression text box.
- From the Source view, highlight a variable name to select
it. Right-click the selection and then choose Quick Watch
from the pop-up menu. The Quick Watch dialog box is
displayed with the selected variable entered in the Expression
text box.
- Keyboard shortcuts are available for moving in the Current
Value area and editing a value. See
Tips in the Quick Watch
Dialog Box reference topic.
- For viewing the value of a simple variable, the dwell feature is
quicker than Quick Watch, but it does not provide as much
information.

Return
to Top |