I can't understand how I can inspect variable content when debugger is stopped due to breakpoint.
Local variable window shows testvar but I cannot see the content of FSampleField and FInnerField.FOtherField.
Am I doing something wrong?
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
type IInner = interface
procedure setOtherField(b: integer);
end;
type TInner = class(TInterfacedObject, IInner)
private var FOtherField: integer;
procedure setOtherField(b: integer);
end;
type ITest = interface
procedure setSampleField(a: string);
procedure setInnerField(b: IInner);
end;
type TTest = class(TInterfacedObject, ITest)
private var FSampleField: string;
private var FInnerField: IInner;
procedure setSampleField(a: string);
procedure setInnerField(b: IInner);
end;
implementation
{$R *.dfm}
procedure TTest.setSampleField(a: string);
begin
FSampleField:= a;
end;
procedure TTest.setInnerField(b: IInner);
begin
FInnerField:= b;
end;
procedure TInner.setOtherField(b: Integer);
begin
FOtherField:= b;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
var testInnerVar: IInner:= TInner.Create();
testInnerVar.setOtherField(55);
var testvar: ITest:= TTest.Create();
testvar.setSampleField('avalue');
testvar.setInnerField(testInnerVar);
end;
end.