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

Andrew Haines AndrewD207 at aol.com
Sat Jan 15 17:01:59 CET 2011


On 01/15/11 10:30, Andrew Haines wrote:
> On 01/14/11 14:38, Torsten Bonde Christiansen wrote:
>> Hi List.
>>
>> Is it possible to jump a couple of levels in the inherited hierarchy
>> when calling "inherited" on a method?
>>
>>
> 
> I *think* I've done this before this way but test it to make sure it works:
> 
> procedure TC.DoSomething:
> begin
>  (Self as TA).DoSomething;
> end;
> 

Okay I tested that and it didn't work.

Does TC.DoSomething do anything other than call inherited from TA? If
not then the following would work

TC = class(TA)
  procedure DoSomething; override;
end;
..

procedure TC.DoSomething; assembler; nostackframe;
asm
 jmp TA.DoSomething
end;



More information about the fpc-pascal mailing list