I often make small methods to assist debugging, which aren\'t used in the actual program. Typically most of my classes has an AsString-method which I add to the watches. I k
Maybe it works to call them in some initialization section, guarded by {IFDEF DEBUG} or {IFOPT D+}.
You can make function published.
TMyClass = class
F : integer;
published
function AsString : string;
end;
And switch on in 'Watch Properties' 'Allow function calls'
sveinbringsli ask: "Do you have a tip for unit functions also?"
Delphi compiler is smart... So you can do something like...
unit UnitA;
interface
{$DEFINE DEBUG}
function AsString: string;
implementation
function AsString: string;
begin
Result := 'Test: ';
end;
{$IFDEF DEBUG}
initialization
exit;
AsString;
{$ENDIF}
end.