A
adomy
Unregistered / Unconfirmed
GUEST, unregistred user!
调试程序一:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function ThreadFunc():Integer;stdcall;
var
count:Integer;
begin
for count:=0 to 10000do
begin
Form1.Edit1.Text:=IntToStr(count);
end;
Form1.Edit1.Text:='线程结束';
Sleep(1000);
ExitThread(5);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Theadid1WORD;
begin
CreateThread(nil,0,@threadfunc,nil,0,Theadid1);
end;
end.
一个简单的调试程序编译通过
调试程序二:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
function ThreadFunc():Integer;stdcall;{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function ThreadFunc():Integer;stdcall;
var
count:Integer;
begin
for count:=0 to 10000do
begin
Form1.Edit1.Text:=IntToStr(count);
end;
Form1.Edit1.Text:='线程结束';
Sleep(1000);
ExitThread(5);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Theadid1WORD;
begin
CreateThread(nil,0,@threadfunc,nil,0,Theadid1);
end;
end
编译出错:出错信息:variable required
这是为什么呢?其中涉及到了些什么问题呢!我想大家也一定遇到过吧!能不能谈谈解释下呢?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function ThreadFunc():Integer;stdcall;
var
count:Integer;
begin
for count:=0 to 10000do
begin
Form1.Edit1.Text:=IntToStr(count);
end;
Form1.Edit1.Text:='线程结束';
Sleep(1000);
ExitThread(5);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Theadid1WORD;
begin
CreateThread(nil,0,@threadfunc,nil,0,Theadid1);
end;
end.
一个简单的调试程序编译通过
调试程序二:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
function ThreadFunc():Integer;stdcall;{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function ThreadFunc():Integer;stdcall;
var
count:Integer;
begin
for count:=0 to 10000do
begin
Form1.Edit1.Text:=IntToStr(count);
end;
Form1.Edit1.Text:='线程结束';
Sleep(1000);
ExitThread(5);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Theadid1WORD;
begin
CreateThread(nil,0,@threadfunc,nil,0,Theadid1);
end;
end
编译出错:出错信息:variable required
这是为什么呢?其中涉及到了些什么问题呢!我想大家也一定遇到过吧!能不能谈谈解释下呢?