[fpc-pascal]inherited keyword

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Dec 21 18:11:09 CET 2003


On Sun, 21 Dec 2003 17:36:00 +0100  Florian Klaempfl
<Florian.Klaempfl at gmx.de> wrote:

> Mattias Gaertner wrote:
> 
> > Can someone explain the semantic difference between *1 and *2 please?
> > 
> > procedure A(p: Type1);
> > begin
> >   inherited; // *1
> >   inherited A(p); // *2
> > end;
> > 
> > ?
> 
> 1: supporting a delphi bug
> 2: as you expect
> 
> Well, the comment to 1 isn't completly true: In method handlers 
> (declared with message XXX), a simply inherited should pass the message 
> to the parent message handle while in usual methods it does nothing.

What do you mean with "it does nothing"? It calls the ancestor method, does
it not?

Back to my initial question: It is indeed about a message method.
I have got a message method where "inherited;" and "inherited
MethodName(Param);" is not always the same. The strange thing is: It depends
on how the objects are created. 
Is this a bug?


Mattias




More information about the fpc-pascal mailing list