Evaluate/Modify

From RAD Studio
Jump to: navigation, search

Go Up to Run Menu

Run > Evaluate/Modify    Ctrl+F7

Evaluates or changes the value of an existing expression or property. This is useful if you want to test a code correction without having to exit the debugger, change the source code, and recompile the program. The Evaluate/Modify dialog box displays the buttons shown in the first column below.

Item Description

Evaluate.png
Evaluate

Evaluates the expression in the Expression edit box and displays its value in the Result edit box.

  • If you are debugging a 64-bit Windows C++ application, you must prepend the register name with a dollar-sign ($) in order to evaluate the contents of a register. For example: $rax
  • On other platforms, the $ is not accepted in a register name.

Modify.png
Modify

Changes the value of the expression in the Expression edit box using the value in the New Value edit box.

Watch.png
Watch

Creates a watch for the expression you have selected.

Inspect.png
Inspect

Opens a new Debug Inspector on the data element you have selected. This is useful for seeing the details of data structures, classes, and arrays.

VisualizersButtonLocVar.png
Visualizers

Displayed only when an external-viewer type visualizer is available for the expression type. Click the down-arrow on the button to select from the available visualizers. A separate window opens to display the data from the visualizer.

Help.png
Help

Displays this help topic.

Expression

Enter the variable, field, array, or object to evaluate or modify. By default, the word at the cursor position in the Code Editor is placed in the Expression edit box. You can accept this expression, enter another one, or choose an expression from the history list of previously evaluated expressions.To evaluate a function call, enter the function name, parentheses, and arguments as you would type it in your program, but leave out the statement-ending semicolon (;).

Result

Displays the value of the item specified in the Expression text box after you choose Evaluate or Modify.

New value

Assigns a new value to the item specified in the Expression edit box. Enter a new value for the item if you want to change its value.



Note: You can evaluate any valid language expression or static variables that are accessible from the current execution point.

Display Format Specifiers

By default, the debugger displays the result in the format that matches the data type of the expression. For example, Integer values are displayed in decimal format. To change the display format, type a comma (,) followed by a format specifier after the expression.

The following table describes the Evaluate/Modify format specifiers:

Specifier Types affected Description

,C

Char, strings

Character.

For Delphi, shows characters for ASCII 0 to 31 in the Delphi language #nn notation.

,S

Char, strings

String.

For Delphi, shows ASCII 0 to 31 in Delphi language #nn notation.

,D

Integers

Decimal. Shows integer values in decimal form, including those in data structures.

,H or ,X

Integers

Hexadecimal. Shows integer values in hexadecimal with the $ prefix, including those in data structures.

,Fn

Floating point

Floating point.

Supported by Delphi only. Shows n significant digits where n can be from 2 to 18. For example, to display the first four digits of a floating-point value, type ,F4. If n is not specified, the default is 11.

,R

Record

Record/Structure.

For Delphi, shows both field names and values, such as (X:1;Y:10;Z:5) instead of (1,10,5).

See Also