In Delphi 7, how to get an instance of a persistent object, given the object identifier in string?
function TForm1.GetObject(Identifier: string): TPersistent;
begin
//what to do here?
end;
Example of use:
//If I have these declared...
public
MyString: string;
MyStringList: TStringList;
//the function will be used something like this
MyString:=TStringList(GetObject('MyStringList')).Text;
Thank you in advance and please apologize me for not being able to express my question clearly in English.