1
我有兩個類型的這樣的班德爾福7:查找財產TObject的德爾福7
TPhone = Class(TPersistent)
private
FNumber: string;
published
property Number: string read FNumber write FNumber;
end;
TPerson = class(TPersistent)
private
FFirstName: string;
FPhone: TPhone;
public
constructor Create;
published
property FirstName: string40 read FFirstName write FFirstName;
property Phone: TPhone read FPhone write FPhone;
end;
我如何在找到電話財產TPerson由它的名字,並返回它作爲a TObject?
也許是這樣的:
function FindPropByName(AObject: TObject; APropName: string): TObject;
注意,電話是子類,沒有原始類型
感謝