[fpc-pascal] class of a class function

CA Gorski fpc-pascal-list at artelogic.com
Tue Aug 7 11:18:46 CEST 2012


How can I get the actual class a class function is called in?


TSomething = class
     class function GetMyClass: TClass;
end;

TOtherthing = class(TSomething)
end;

...

class function TSomething.GetMyClass: TClass;
begin
     Result:=???;
end;

...

var
     MyVar: TClass;


MyVar:=TOtherthing.GetMyClass; // MyVar should be set to TOtherthing



More information about the fpc-pascal mailing list