inherited lazarus / 7-LCL ---------------------------------------------------------------------- =sniper= · 2006-06-18 13:09 procedure TSomeClass.MyProc; begin   inherited; ... end; why I had this message "... Error: Abstract methods can't be called directly" but Delphi compile it without problem? ---------------------------------------------------------------------- Almindor · 2006-06-18 13:30 if TSomeClass has a Parent which has procedure MyProc; virtual; abstract; then calling "inherited" equals calling an abstract method, which would crash. If delphi compiles this it means it has less intelligent error handling than FPC. ---------------------------------------------------------------------- Anonymous · 2006-06-18 17:33 It look's like this procedure MyProc(aTime : Integer); override; ---------------------------------------------------------------------- Almindor · 2006-06-19 18:57 I need to see how the parent looks ---------------------------------------------------------------------- Anonymous · 2006-06-19 21:13 yes Parent class looks like procedure MyProc(aElapsedTime : Integer); virtual; abstract; now what should I do? Delete this inheriteds? ---------------------------------------------------------------------- Anonymous · 2006-06-20 05:32 Parent class function actually ---------------------------------------------------------------------- Almindor · 2006-06-20 05:58 you can't call inherited in a descendent which has abstract method in parent. Delphi perhaps let you run it but it'd crash on that code. ---------------------------------------------------------------------- RudieD · 2006-06-20 18:22 No, I think Delphi just ignores it . ---------------------------------------------------------------------- Almindor · 2006-06-21 13:18 well it should throw an exception ---------------------------------------------------------------------- RudieD · 2006-06-21 17:28 I also like the exception route. ---------------------------------------------------------------------- Marc · 2006-06-23 08:49 Yes and no. In most cases you don't have to know what the original function does whan you want to add some functionality. IMO for those cases calling inherited should not raise an exception. (I find the FPC behaviour on this a bit annoying) ---------------------------------------------------------------------- RudieD · 2006-06-23 15:33 What about a warning message then ? So that if you expect a ancestors method to do something, you will at least know if theres nothing there. ---------------------------------------------------------------------- Almindor · 2006-06-26 15:54 no it should, abstract simply is ment to force programmers to make something. Otherwise use just an empty virtual one.