-Ariel Mendelzon
HTH, Glynn
interface
uses Forms, Classes;
type
TFormExtra = class(TForm)
private
FExtra: Integer;
public
constructor Create(AOwner: TComponent; Extra: Integer); reintroduce;
end;
implementation
{ TFormExtra }
constructor TFormExtra.Create(AOwner: TComponent; Extra: Integer);
begin
FExtra := Extra;
inherited Create(AOwner);
end;
end.
--
Ross Hemingway
Redeclare the constructor and use "reintroduce" to avoid the compiler
warning. Remember to call the inherited constructor, eg.
procedure TMyForm.Create(MyOwner: TComponent; MyParam: TMyParam);
begin
inherited Create(MyOwner);
...
end;
Cheers,
Carl
interface
uses Forms, Classes;
type
TFormExtra = class(TForm)
private
FExtra: Integer;
public
constructor Create(AOwner: TComponent; Extra: Integer); reintroduce;
end;
implementation
{ TFormExtra }
constructor TFormExtra.Create(AOwner: TComponent; Extra: Integer);
begin
inherited Create(AOwner);
FExtra := Extra;
end;
end.
--
Ross Hemingway
constructor TMyForm.Create (AOwner : TComponent; AMyValue : string);
begin
inherited Create (AOwner);
FMyValue := AMyValue;
end;
HTH
in article <966ln9$sr...@bornews.inprise.com>, you wrote:
> I have a little problem: I need to create a form sending it extra parameters
> and I don't know how to...... I can't overload the constructor or create a
> new one because delphi raises an error...
> does anyone know how to do this??
> thank you so much
>
type
TForm2 = class(TForm)
<deletia>
private
{ Private declarations }
public
{ Public declarations }
constructor Create(AOwner: TComponent; ACaption: string); reintroduce;
overload;
end;
var
Form2: TForm2;
implementation
{$R *.DFM}
constructor TForm2.Create(AOwner: TComponent; ACaption: string);
begin
inherited Create(AOwner);
Caption := ACaption;
end;
--
Regards
Ralph (TeamB)
===