为了简化我的问题,我引用了一个像这样的课程
Base = class;
public:
Name: String;
end;
Derived = class(Base)
public:
Name: String;
end;
Procedure Book.DoSomething;
Var
str: String;
Begin
str := derivObj.Name; //I need base class Name not the Derived one
End;
我对Delphi非常陌生,所以请帮帮我。
答案 0 :(得分:4)
要访问父类成员: str:= Base(derivObj).Name;