<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Am 13.11.2013 02:57, schrieb Xiangrong
Fang:<br>
</div>
<blockquote
cite="mid:CAP93jB3Ai+pq-fQ1c4Nb6oGEZnBeA511StkjLSCXrarrAx1A2A@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_default" style="font-family:'courier
new',monospace">Hi,</div>
<div class="gmail_default" style="font-family:'courier
new',monospace"><br>
</div>
<div class="gmail_default" style="font-family:'courier
new',monospace">
Is it OK to use "inherited" in any instance method? i.e.</div>
<div class="gmail_default" style="font-family:'courier
new',monospace"><br>
</div>
<div class="gmail_default" style="font-family:'courier
new',monospace">
It is OK to do this:</div>
<div class="gmail_default" style="font-family:'courier
new',monospace"><br>
</div>
<div class="gmail_default" style="font-family:'courier
new',monospace">procedure TChildClass.DoIt;//override</div>
<div class="gmail_default" style="font-family:'courier
new',monospace">begin</div>
<div class="gmail_default" style="font-family:'courier
new',monospace"> inherited DoIt;</div>
<div class="gmail_default" style="font-family:'courier
new',monospace">
end;</div>
<div class="gmail_default" style="font-family:'courier
new',monospace"><br>
</div>
<div class="gmail_default" style="font-family:'courier
new',monospace">But is it ok to do this:</div>
<div class="gmail_default" style="font-family:'courier
new',monospace">
<br>
</div>
<div class="gmail_default" style="font-family:'courier
new',monospace">
<div class="gmail_default">procedure
TChildClass.SomethinElse;//NOT DoIt</div>
<div class="gmail_default">begin</div>
<div class="gmail_default">
inherited DoIt;</div>
<div class="gmail_default"> //... ...</div>
<div class="gmail_default">end;</div>
<div><br>
</div>
<div>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"?</div>
</div>
</div>
</blockquote>
You can always use "inherited" to call a method of the given name in
the next parent class that has such a method (Note: there are a few
exceptions: If no such methods exist (compile time error) and if the
method is abstract (also compile time error))<br>
<br>
Regards,<br>
Sven<br>
</body>
</html>