I declared some simple classes in the program, for example
MyClass = class
Var1 : Integer
Var2 : Integer
end;
What I would like to do is get a list of variables of this class ("MyClass") at runtime (maybe something like "GetPropList" for components?)
I mean something like this (obviously, the โGetVarNamesโ function does not exist, but I hope this gives an idea), which will pull the names of the variables listed in โMyClassโ into strings in a TStringList:
var
MyVariableNamesList: TStringList
i : integer;
begin
MyVariableNamesList := TStringList.create;
MyVariableNamesList := GetVarNames(MyClass)
end;
Can anyone advise? Sorry in advance if this is a stupid question!
source
share