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

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


On 01/15/11 11:01, Andrew Haines wrote:
> 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.
> 

For some reason this problem intrigued me so I played around with it and
came up with the attached program that demonstrates a solution that
seems not too hackish to me. (Even though it is one). TC.Dosomething
calls TA.DoSomething and can also have it's own vars and code.

Regards,

Andrew
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: project1.lpr
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20110115/32234b61/attachment.ksh>


More information about the fpc-pascal mailing list