[fpc-pascal] use of "inherited" keyword

Xiangrong Fang xrfang at gmail.com
Wed Nov 13 02:57:39 CET 2013


Hi,

Is it OK to use "inherited" in any instance method? i.e.

It is OK to do this:

procedure TChildClass.DoIt;//override
begin
  inherited DoIt;
end;

But is it ok to do this:

procedure TChildClass.SomethinElse;//NOT DoIt
begin
  inherited DoIt;
  //... ...
end;

I tried, it seems ok, but I am not sure, because I had a strange access
violation in my code which I cannot reproduce in simplified version of the
code, so I suspect this might be an invalid use and "correct by
coincidence"?

Thanks!
Xiangrong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20131113/283c60e2/attachment.html>


More information about the fpc-pascal mailing list