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
Fpcupdeluxe
by
DonAlfredo
[
Today
at 10:22:45 am]
Star Wars Galaxian
by
PierceNg
[
Today
at 10:10:44 am]
Unleashed Pascal (async/a...
by
Fibonacci
[
Today
at 08:27:13 am]
QGradientTrackPanel: A Fu...
by
Boleeman
[
Today
at 07:13:07 am]
[closed] Is case for stri...
by
egsuh
[
Today
at 06:39:17 am]
New charts
by
Boleeman
[
Today
at 04:26:40 am]
Fast Canvas Library V1.05...
by
Gigatron
[
Today
at 01:28:23 am]
How to define the SQLite3...
by
jamie
[
Today
at 01:26:49 am]
kOmniXML for Lazarus and ...
by
PeterEvans
[
Today
at 01:11:14 am]
Finding List of Fonts & P...
by
J-G
[August 09, 2026, 11:05:31 pm]
[Scrubbed] Question about...
by
jamie
[August 09, 2026, 08:47:34 pm]
Bug: XLSX writer does not...
by
wp
[August 09, 2026, 08:29:22 pm]
New Big Integer library i...
by
ad1mt
[August 09, 2026, 05:32:14 pm]
Automatic generation of *...
by
PeterBB
[August 09, 2026, 01:38:51 pm]
TyControls: a custom-draw...
by
Antek
[August 09, 2026, 12:07:39 pm]
PO-Editor MyLangEdit3 now...
by
dbannon
[August 09, 2026, 07:55:47 am]
Application triggers mess...
by
JanRoza
[August 09, 2026, 12:26:52 am]
[solved] form reset/reloa...
by
ADMGNS
[August 08, 2026, 09:58:42 pm]
Create small language
by
ADMGNS
[August 08, 2026, 09:52:19 pm]
Advatage Database server
by
neobrasil08
[August 08, 2026, 08:42:18 pm]
How get listy of FieldDat...
by
Aruna
[August 08, 2026, 04:02:16 pm]
Identify network devices
by
LemonParty
[August 08, 2026, 03:44:03 pm]
how to connect to mariadb...
by
Mike.Cornflake
[August 08, 2026, 12:25:31 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: inherited (Read 11574 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: 2706
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