Link to home
Start Free TrialLog in
Avatar of And1j
And1j

asked on

Unsatisfied forward ... child form

Hi,

I am a beginner at this: I'm testing the showmodal functions with Delphi 6.0 . I keep getting an error:"Unsatisfied forward or extarnal decleration: 'TfrmFormopen.Start' "...

I've tried to change the function call in the public declarations, but still no improvements.What am I doing wrong?

Code:
unit untFormopen;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TfrmFormopen = class(TForm)
    Label1: TLabel;
    btnClose: TButton;
    btnOk: TButton;
    edtTekst: TEdit;
    procedure btnCloseClick(Sender: TObject);
    procedure btnOkClick(Sender: TObject);
  private
    { Private declarations }
  public
 {Public declarations}
 function Start : Boolean;
 end;
var
  frmFormopen: TfrmFormopen;

implementation

{$R *.dfm}

function Start : Boolean;
begin
Showmessage ('Finally accomplished');
frmFormopen.edtTekst.Clear;
Result := frmFormopen.ShowModal = mrOK;
end;

procedure TfrmFormopen.btnCloseClick(Sender: TObject);
begin
Modalresult := MrCancel;
end;

procedure TfrmFormopen.btnOkClick(Sender: TObject);
begin
Modalresult := MrOk;
end;

end.
ASKER CERTIFIED SOLUTION
Avatar of Darth_helge
Darth_helge

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Darth_helge
Darth_helge

nb!

don't change it at the declaration. the unit should look like this.

unit untFormopen;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TfrmFormopen = class(TForm)
    Label1: TLabel;
    btnClose: TButton;
    btnOk: TButton;
    edtTekst: TEdit;
    procedure btnCloseClick(Sender: TObject);
    procedure btnOkClick(Sender: TObject);
  private
    { Private declarations }
  public
 {Public declarations}
 function Start : Boolean;
 end;
var
  frmFormopen: TfrmFormopen;

implementation

{$R *.dfm}

function TFrmForm.Start : Boolean;
begin
Showmessage ('Finally accomplished');
frmFormopen.edtTekst.Clear;
Result := frmFormopen.ShowModal = mrOK;
end;

procedure TfrmFormopen.btnCloseClick(Sender: TObject);
begin
Modalresult := MrCancel;
end;

procedure TfrmFormopen.btnOkClick(Sender: TObject);
begin
Modalresult := MrOk;
end;

end.