Modifying the Value of a Variable or Contents of a Register

Home Page (Debugger)OverviewHow Do I... Topics

When the program is paused at a breakpoint or between steps, you can change the value of any non-const variable or contents of any register (including Intel MMX registers). 

What do you want to do?

Modify the value of a variable or contents of a register using QuickWatch

Modify the value of a variable or contents of a register using the Watch window

Modify the value of a variable in the Variables window

To modify the value of a variable or contents of a register using QuickWatch

  1. On the Debug menu, click QuickWatch.

  2. In the Expression text box, type the variable or register name.

  3. Click the Recalculate button.

  4. If the variable is an array or object, use the + box to expand the view until you see the value you want to modify.

  5. Use the TAB key to move to the value you want to modify.

  6. Type the new value, and then press ENTER.

  7. Click Close.

Tip   To change the value of an array, modify the individual fields or elements. You cannot edit an entire array at once.

To modify the value of a variable or contents of a register using the Watch window

  1. In the Watch window, double-click the value.

    – or –

    Use the TAB key to move the insertion point to the value you want to modify.

  2. If the variable is an array or object, use the + box to expand the view until you see the value you want to modify.

  3. Type the new value, and press ENTER.

To modify the value of a variable in the Variables window

  1. In the Variables window, click the Auto tab, Locals tab, or This tab.

  2. Select the line containing the variable whose type you want to modify.

  3. If the variable is an array or object, use the + box to expand the view until you see the value you want to modify.

  4. Double-click the value, or use the TAB key to move the insertion point to the value you want to modify.

  5. Type the new value, and press ENTER. The new value appears in red.