S
sevenqitao
Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下:
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure Initialize;
// procedure Initialize;
private
{ Private declarations }
public
// procedure Initialize;
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
var
Str1:string;
procedure Initialize;
begin
Str1 := Form1.Edit1.Text;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Initialize;
ShowMessage(Str1);
end;
end.
执行后会显示'unsatisfied forward or external declaration:'TForm1.initialize''.
为什么自定义例程要放在type里面,不放也可以正常执行呀?
谢谢
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure Initialize;
// procedure Initialize;
private
{ Private declarations }
public
// procedure Initialize;
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
var
Str1:string;
procedure Initialize;
begin
Str1 := Form1.Edit1.Text;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Initialize;
ShowMessage(Str1);
end;
end.
执行后会显示'unsatisfied forward or external declaration:'TForm1.initialize''.
为什么自定义例程要放在type里面,不放也可以正常执行呀?
谢谢