debuggingdelphiexpression-evaluation

Delphi debug - can I show field names, not just values when evaluating?


When I evaluate a variable with Ctrl+F7, it's fine with a simple variable. But, when I have something more complex:

Delphi Evaluate/Modify dialog

...is there any way to show the names of the fields corresponding to those values?


Solution

  • Per the documentation for the Evaluate/Modify dialog, you can append ,R to the end of the expression, eg myControl,R:

    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
    ... ... ...
    ,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).