-2

为了简化我的问题,我引用了这样的课程

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;

我对德尔福非常陌生,所以请帮帮我。

4

1 回答 1

4

访问父类成员: str := Base(derivObj).Name;

于 2013-08-19T13:19:32.207 回答