can inherited simply replace inherited method(param1, param2, param3)?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

can inherited simply replace inherited method(param1, param2, param3)?

Dennis
are the 2 below equivalent?

procedure Method(param1, param2 : integer);
begin
   inherited;
end;



procedure Method(param1, param2 : integer);
begin
   inherited Method(param1, param2);
  end;

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: can inherited simply replace inherited method(param1, param2, param3)?

Mattias Gaertner
On Fri, 12 Jan 2018 00:35:30 +0800
Dennis <[hidden email]> wrote:

> are the 2 below equivalent?
>
> procedure Method(param1, param2 : integer);
> begin
>    inherited;
> end;
>
>
>
> procedure Method(param1, param2 : integer);
> begin
>    inherited Method(param1, param2);
>   end;

Yes.

Mattias
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: can inherited simply replace inherited method(param1, param2, param3)?

Graeme Geldenhuys-6
In reply to this post by Dennis
On 2018-01-11 16:35, Dennis wrote:
> are the 2 below equivalent?

Yes they are. Lazarus IDE auto implements the later, and Delphi IDE the
first. What is again annoying about Delphi IDE is that it chooses to
generate "inherited;" lines, but then can't allow you to code navigate
(Ctrl+LeftClick). You have to manually fix the generated code like your
second example before Delphi IDE can code navigate to the parent
implementation.

Yet another reason why Lazarus IDE is so much better than Delphi XE onwards.

Regards,
   Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal