<p>Hi, I don't test it in fp. But in Delphi I just create virtual method with empty body in this situation.</p>
<div class="gmail_quote">24.01.2013 15:11 пользователь "xrfang" <<a href="mailto:xrfang@gmail.com">xrfang@gmail.com</a>> написал:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<font face="monospace">Hi All,</font><div><font face="monospace"><br></font></div><div><font face="monospace">I wrote a TPainter abstract class, and a TPaintRect class. In the TPaintRect class I have this code:</font></div>
<div><br></div><div><font face="monospace">procedure TPaintRect.OnMouseEnter(Sender: TObject);</font></div><div><font face="monospace">var</font></div><div><font face="monospace"> i: Integer;</font></div><div><font face="monospace"> p: TPainter;</font></div>
<div><font face="monospace">begin</font></div><div><font face="monospace"> for i := 0 to painters.Count - 1 do begin</font></div><div><font face="monospace"> p := TPainter(painters.Objects[i]);</font></div><div><font face="monospace"> try</font></div>
<div><font face="monospace"> p.OnMouseEnter(Sender);</font></div><div><font face="monospace"> except on EAbstractError do ; end;</font></div><div><font face="monospace"> end;</font></div><div><font face="monospace"> if Assigned(FOnMouseEnter) then FOnMouseEnter(Sender);</font></div>
<div><font face="monospace">end;</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">While running in IDE, the program will crash because OnMouseEnter is abstract.</font></div><div><font face="monospace"><br>
</font></div><div><font face="monospace">My problems are:</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">1) As I already wrapped it with try-except, I hope it won't trigger IDE exception. But even I turn off "Notify on Lazarus Exception" in debugger options it still pops up, and the popup said RunError(211), NOT EAbstractError. The program runs well outside of IDE.</font></div>
<div><font face="monospace"><br></font></div><div><font face="monospace">2) Is there a way to detect if an abstract method is implemented or not, without trying to call it and try...except?</font></div><div><font face="monospace"><br>
</font></div><div><font face="monospace">Thanks,</font></div><div><font face="monospace">Shannon</font></div><div><font face="monospace"><br></font></div><div><br></div><br>--<br>
_______________________________________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
<br></blockquote></div>