[fpc-pascal] casting back a pointer to original type

David Emerson dle3ab at angelbase.com
Sun May 30 01:47:34 CEST 2010


On Sat 29 May 2010, spir ☣ wrote:
> I cannot do that. C0 (and all classes) instances need a text method. I also
> cannot have 2 methods (one static, one virtual) with different names. 

So make a virtual method called text. Don't use a static method at all.

In my example I was trying to demonstrate the difference between static methods 
and virtual methods. I was not trying to suggest that you change your method 
names, or use both static and virtual methods.

I can't be sure without seeing your code, but based on reading your messages 
three times, it appears to me that you are using static methods (i.e. without 
the virtual and override keywords) and expecting them to behave like virtual 
methods.

Cheers & good luck,
David




More information about the fpc-pascal mailing list