H
hgptm
Unregistered / Unconfirmed
GUEST, unregistred user!
begin
Thread如何傳遞參數呢?
問題如下:
var th2:cardinal;
h2:integer;
procedure Test(StartPos: integer);
var i:integer;
begin
i:=startPos;
while truedo
begin
application.ProcessMessages ;
i:=i+1;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);//啟動線程
begin
h2:=begin
thread(nil,1024,@Test,[red]這裡如何傳遞[/red]?,0,th2);
end;
Thread如何傳遞參數呢?
問題如下:
var th2:cardinal;
h2:integer;
procedure Test(StartPos: integer);
var i:integer;
begin
i:=startPos;
while truedo
begin
application.ProcessMessages ;
i:=i+1;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);//啟動線程
begin
h2:=begin
thread(nil,1024,@Test,[red]這裡如何傳遞[/red]?,0,th2);
end;