[fpc-pascal] Skipping an the "inherited" of an ancestor

Torsten Bonde Christiansen tc at epidata.dk
Fri Jan 14 20:38:33 CET 2011


Hi List.

Is it possible to jump a couple of levels in the inherited hierarchy 
when calling "inherited" on a method?

A small example of what i'm trying to achieve below (and don't mind the 
incomplete TB class implementation).

Kind regards,
Torsten Bonde Christiansen.

============================

TA = class
   procedure DoSomething; virtual;
end;

TB = class(TA)
   procedure DoSomething; override;
end;

TC = class(TB)
   procedure DoSomething; override;
end;

.....

procedure TA.DoSomething;
begin
   ...
end;

procedure TC.DoSomething;
begin
   inherited TA.DoSomething;  // This is not correct, but exemplifies 
what i'm trying to achieve.
end;





More information about the fpc-pascal mailing list