[lazarus] FPC Request

Marc Weustink weus at quicknet.nl
Mon Oct 25 17:07:47 EDT 1999


At 22:12 25-10-99 +0200, Florian Klaempfl wrote:
>Marc Weustink wrote:
>> 
>> At 21:01 23-10-99 +0200, Florian Klaempfl wrote:
>> >Shane Miller schrieb:

[Single inherited usage in overidden methods]

>> >
>> >I think this should work only in message handlers, but even there it
doesn't
>> >work.
>> 
>> In delphi it works in every overidden method
>> 
>
>What are the rules for paramter passing?

If you have something like:

  MyClass = class
  public
    procedure MyMethod(Param1, Param2: Integer); virtual;
  end;

  MyOtherClass = class(MyClass)
  public
    procedure MyMethod(Param1, Param2: Integer); override;
  end;

you can use inherited like:

  procedure MyOtherClass.MyMethod(Param1, Param2: Integer);
  begin
    inherited;
  end;

or like:

  procedure MyOtherClass.MyMethod(Param1, Param2: Integer);
  begin
    inherited MyMethod(Param1, Param2);
  end;

Both are the same. Delphi nows that MyClass.MyMethod needs 2 params, and
passes  them to the inherited method.

Marc






More information about the Lazarus mailing list