Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Miscellaneous
»
Suggestions
»
LCL
»
inherited
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
could Ardour's YTK be use...
by
robert rozee
[
Today
at 09:29:10 am]
lazarus 4.99 and missing ...
by
ginoo
[
Today
at 08:28:52 am]
GTK3 : Icons have borders...
by
AmatCoder
[
Today
at 07:49:59 am]
CONCAT formula
by
veb86
[
Today
at 07:26:49 am]
Questions about TFuncSeri...
by
hedgehog
[
Today
at 06:58:29 am]
Getting results from sql ...
by
paweld
[
Today
at 06:05:00 am]
Problem with drawing orde...
by
wp
[
Today
at 12:57:00 am]
Initialization & finaliza...
by
Martin_fr
[March 14, 2026, 10:22:21 pm]
Hello! Anything new?
by
440bx
[March 14, 2026, 07:51:50 pm]
CryptoLib4Pascal
by
Xor-el
[March 14, 2026, 06:17:32 pm]
Extended Module Player
by
Gigatron
[March 14, 2026, 05:32:06 pm]
[AGGPas] Difference betwe...
by
Roland57
[March 14, 2026, 04:36:02 pm]
declaring Array
by
Thaddy
[March 14, 2026, 01:24:11 pm]
TChart: Wrong default val...
by
wp
[March 14, 2026, 11:30:54 am]
Text Fill (Memo)
by
paweld
[March 14, 2026, 09:09:13 am]
Qt6/Wayland clipboard: pa...
by
AlexTP
[March 14, 2026, 08:56:58 am]
Pocketbase
by
PierceNg
[March 14, 2026, 06:29:04 am]
ADUG Symposium 2026
by
Mathias Burbach
[March 14, 2026, 04:45:57 am]
Any way to "embed" Window...
by
jamie
[March 14, 2026, 12:55:37 am]
DataPort StopBits and Flo...
by
Thaddy
[March 13, 2026, 02:14:16 pm]
Lazarus Bugfix Release 4....
by
JuhaManninen
[March 13, 2026, 10:05:03 am]
88 year D. Knuth changes ...
by
Thaddy
[March 13, 2026, 07:31:38 am]
interface and GUID someth...
by
egsuh
[March 13, 2026, 03:31:00 am]
CADSys4 3D.
by
maurog
[March 13, 2026, 01:00:05 am]
UOS - pre-compiled librar...
by
Fred vS
[March 13, 2026, 12:34:06 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: inherited (Read 11426 times)
=sniper=
Guest
inherited
«
on:
June 18, 2006, 03:09:13 pm »
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?
Logged
Almindor
Sr. Member
Posts: 412
RE: inherited
«
Reply #1 on:
June 18, 2006, 03:30:21 pm »
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.
Logged
Anonymous
Guest
RE: inherited
«
Reply #2 on:
June 18, 2006, 07:33:58 pm »
It look's like this
procedure MyProc(aTime : Integer); override;
Logged
Almindor
Sr. Member
Posts: 412
RE: inherited
«
Reply #3 on:
June 19, 2006, 08:57:37 pm »
I need to see how the parent looks
Logged
Anonymous
Guest
RE: inherited
«
Reply #4 on:
June 19, 2006, 11:13:58 pm »
yes Parent class looks like
procedure MyProc(aElapsedTime : Integer); virtual; abstract;
now what should I do? Delete this inheriteds?
Logged
Anonymous
Guest
RE: inherited
«
Reply #5 on:
June 20, 2006, 07:32:36 am »
Parent class function actually
Logged
Almindor
Sr. Member
Posts: 412
RE: inherited
«
Reply #6 on:
June 20, 2006, 07:58:47 am »
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.
Logged
RudieD
Full Member
Posts: 234
RE: inherited
«
Reply #7 on:
June 20, 2006, 08:22:15 pm »
No, I think Delphi just ignores it .
Logged
The FRED Trainer. (Training FRED with Lazarus/FPC)
Almindor
Sr. Member
Posts: 412
RE: inherited
«
Reply #8 on:
June 21, 2006, 03:18:34 pm »
well it should throw an exception
Logged
RudieD
Full Member
Posts: 234
RE: inherited
«
Reply #9 on:
June 21, 2006, 07:28:32 pm »
I also like the exception route.
Logged
The FRED Trainer. (Training FRED with Lazarus/FPC)
Marc
Administrator
Hero Member
Posts: 2674
RE: inherited
«
Reply #10 on:
June 23, 2006, 10:49:07 am »
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)
Logged
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the
bug tracker
RudieD
Full Member
Posts: 234
RE: inherited
«
Reply #11 on:
June 23, 2006, 05:33:41 pm »
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.
Logged
The FRED Trainer. (Training FRED with Lazarus/FPC)
Almindor
Sr. Member
Posts: 412
RE: inherited
«
Reply #12 on:
June 26, 2006, 05:54:44 pm »
no it should, abstract simply is ment to force programmers to make something. Otherwise use just an empty virtual one.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Miscellaneous
»
Suggestions
»
LCL
»
inherited
TinyPortal
© 2005-2018