Hi I am have a problem debugging code that uses a ‘WITH’ statement in BDS 2006 The debugger will not show the values of the variables with in a class or record. Am I doing something wrong or does BDS 2006 have a bug ?
type
TNumber = class
Num: Integer;
end;
implementation
{$R *.dfm}
var
MyNumber: TNumber;
procedure TForm2.FormCreate(Sender: TObject);
begin
MyNumber := TNumber.Create;
MyNumber.Num := 10; /// MyNumber.Num Can be seen with debugger
with MyNumber do
begin
Num := Num +1 ; /// Num is not seen by the debugger
MyNumber.Num := Num +1 ; /// MyNumber.Num is seen but Num is not seen by the debugger
end;
end;
EDIT:
Sure one can use the full name of the variable But things become very messy if you have a complex structure with more than one level