Modifying Variable Expressions

From RAD Studio
Jump to: navigation, search

Go Up to How To Use the Debugger


After you have evaluated a variable or data structure item, you can modify its value. When you modify a value through the debugger, the modification is effective for the program run only. Changes you make through the Evaluate/Modify dialog box do not affect your source code or the compiled program. To make your change permanent, you must modify your source code in the Code Editor, then recompile your program.

To change the value of an expression

  1. Choose Run > Evaluate/Modify.
  2. Specify the expression in the Expression edit box.To modify a component property, specify the property name; for example, this.button1.Height or Self.button1.Height.
  3. Enter a value in the New Value edit box.The expression must evaluate to a result that is assignment-compatible with the variable you want to assign it to. Typically, if the assignment would cause a compile or run-time error, it is not a legal modification value.
  4. Choose Modify.The new value is displayed in the Result box.You cannot undo a change to a variable after you choose Modify. To restore a value, however, you can enter the previous value in the Expression box and modify the expression again.

Note: You can change individual variables or elements of arrays and data structures, but you cannot change the contents of an entire array or data structure with a single expression.

Warning: Modifying values (especially pointer values and array indexes), can have undesirable effects because you can overwrite other variables and data structures. Use caution whenever you modify program values from the debugger.

See Also