When creating a class that inherits from another class, shouldn't it be true that when the derived class is created the base classes's constructor is called?
Type
TBase = Class
constructor xMain;
End;
TDerived = Class(TBase)
constructor xMain;
End;
constructor TBase.xMain;
begin
MessageBox(0,'TBase','TBase',0);
end;
constructor TDerived.xMain;
begin
MessageBox(0,'TDerived','TDerived',0);
end;
Var
xTClass:TDerived;
begin
xTClass := TDerived.xMain;
end.
I thought this should result in a MessageBox displaying "TBase" and then "TDerived". Yet, this is not the case. When the above code is ran it only results in one MessageBox displaying "TDerived".