Vote UpVote

Implicit vs Explicit Call to inherited

Francois on Programming – When overriding a method, you have the choice to call the ancestor method implicitly with the inherited keyword alone or with also the method name and its parameters if any. Does it make a difference? Why choose one or the other? procedure TForm2.AfterConstruction; begin inherited; MessageBox(0, 'Hello!', 'Test', MB_ICONINFORMATION or MB_OK); end; vs procedure TForm2.AfterConstruction; begin inherited AfterConstruction; MessageBox(0, 'Hello!', 'Test', MB_ICONINFORMATION or MB_OK); end; Compiled code It does not matter for the compiler as it knows the proper ancestor’s method ...
Favorite? Off-Topic? François Gaillard @ 2010-09-26 09:48


Visits: 32
Votes: 0
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


Please login or register to use this functionality.
(click on this box to dismiss)