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
WIKI Timeout issues
Please read here if you have trouble connecting to the wiki
Recent
Why does $fpctarget not w...
by
Gustavo 'Gus' Carreno
[
Today
at 05:35:14 am]
The issue of the scroll b...
by
jianwt
[
Today
at 03:35:22 am]
How can I uninstall the p...
by
xiyi0616
[
Today
at 02:58:30 am]
Does anyone have experien...
by
xiyi0616
[
Today
at 02:31:06 am]
Youtube Downloader in Pas...
by
yus
[
Today
at 01:40:58 am]
Debugger regression in La...
by
TheMouseAUS
[
Today
at 01:26:53 am]
Lazarus & FPC documentati...
by
wp
[
Today
at 01:26:50 am]
Not happy with TTimeEdit
by
gues1
[July 16, 2025, 10:58:04 pm]
THUMBBUTTON does not work...
by
ASerge
[July 16, 2025, 09:22:18 pm]
Lazarus Release 4.0
by
ManoelJr
[July 16, 2025, 08:35:45 pm]
fpc in [home] folder not ...
by
DonAlfredo
[July 16, 2025, 08:32:39 pm]
Debugger use on OBJECT ty...
by
Martin_fr
[July 16, 2025, 08:16:43 pm]
RuntimeError 103 File not...
by
gues1
[July 16, 2025, 07:51:44 pm]
Asking for an example of ...
by
Thaddy
[July 16, 2025, 07:33:15 pm]
Suddenly a build error? [...
by
TBMan
[July 16, 2025, 07:04:45 pm]
Is Lazarus still serious ...
by
Thaddy
[July 16, 2025, 05:10:53 pm]
TMemoryStream Question wi...
by
Thaddy
[July 16, 2025, 03:57:33 pm]
Problems with libraries f...
by
DonAlfredo
[July 16, 2025, 03:03:27 pm]
Possible Bug or Known Beh...
by
Aruna
[July 16, 2025, 02:48:41 pm]
It does not show my progr...
by
RayoGlauco
[July 16, 2025, 02:48:05 pm]
activex.pp DosDateTimeToV...
by
440bx
[July 16, 2025, 02:09:39 pm]
"Mario & Luigi" (1994-200...
by
Nimbus
[July 16, 2025, 12:14:31 pm]
UTF8 Keyboard entry
by
Thaddy
[July 16, 2025, 06:17:25 am]
Will there be a freezing ...
by
xiyi0616
[July 16, 2025, 04:25:25 am]
GitHub action setup-lazar...
by
Gustavo 'Gus' Carreno
[July 16, 2025, 01:03:07 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: inherited (Read 11170 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: 2650
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