On 4/3/09, Jonas Maebe <jonas.ma...@elis.ugent.be> wrote:
>  I think what is meant, is that if you create a direct subclass of TObject,
> there is no need to call TObject's create constructor (e.g., via "inherited
> create;") from your own constructors. It doesn't hurt if you do it of
> course, and may be good practice to account for future situations where the
> parent class may change.

I often wondered abou that.

So if i understand correctly:

Say I have

Type
  TFoo = class;
  private
    fSomeField: Integer;
  public
    constructor Create;
  end;

then

constructor  TFoo.Create
begin
  Inherited Create;
  fSomeField := -1;
end;

would in essence be equal to

constructor  TFoo.Create
begin
  fSomeField := -1;
end;

Since TOblect.Create "does nothing".

Bart
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to