The function GetTypeData() in unit TypInfo should give you that information. It's described (more or less) in the RTL help file.
Note: I'm not much versed in this so I may be wrong
@PascalDragon
..
Methods can be done like this:
// methods
{$mode objfpc}
uses typinfo, classes;
var
O:Tobject;
List:Tstringlist;
Info:PTypeInfo;
Data:PTypeData;
begin
O := Tobject.Create;
try
Info :=TypeInfo(@O.ToString);
Data :=GetTypeData(Info);
writeln(Info^.Kind);
if (Info^.kind = tkMethod) and (Data^.MethodKind = mkFunction) then
begin
List := TStringlist.Create;
try
List.Text := Data^.ParamList;
writeln('This is a method Function with result type ', list[2])
finally
list.free;
end
end;
finally
O.free;
end;
end.
I tested with some methods and it worked.
Thank you.
The only problem I found was in:
List.Text := Data^.ParamList
For example, it is returned:
Data^.ParamList = #7'LongIntp'#163'X'#0#0#0#0#0#15#6'TForm1' ....
And the return is not broken into rows in the StringList, but this I can solve.
Another question, is it possible to get the parameter list (name and data type)?