O
optn3
Unregistered / Unconfirmed
GUEST, unregistred user!
//线程
procedure TTestThread1.Execute;
var
str1,str2,str3 : String;
i,j,k,g,num,line,fu: integer;
sav:string;
wa:integer;
ss:TStringList;
R: set of 1..6;
M, N,Count: Integer;
begin
FreeOnTerminate := true;
ss:=TStringlist.Create;
randomize;
num := strtoint(form1.ComboBox1.Text)+1;
line := strtoint(form1.edit1.Text);
fu := form1.memo3.Lines.Count;
i:=1;
for i:=1 to linedo
begin
j:=1;
str2 := '';
str2 := Chr(Random(30) + Ord('A'))+ inttostr(Random(7) + 1);
while j<= num-2do
begin
g:=random(fu);
str2 := str2+'+'+Chr(Random(30) + Ord('A'))+inttostr(Random(7) + 1);
j := j+1;
Sleep(0);
end;
ss.Add(str2) ;
end;
tmps.Text := ss.Text;
ss.Free;
end;
//主窗口调入
procedure TForm1.Button1Click(Sender: TObject);
var
newthread : TTestThread1;
begin
newthread := TTestThread1.Create(false);
end;
//出现的错误 窗口句柄是非法的?
procedure TTestThread1.Execute;
var
str1,str2,str3 : String;
i,j,k,g,num,line,fu: integer;
sav:string;
wa:integer;
ss:TStringList;
R: set of 1..6;
M, N,Count: Integer;
begin
FreeOnTerminate := true;
ss:=TStringlist.Create;
randomize;
num := strtoint(form1.ComboBox1.Text)+1;
line := strtoint(form1.edit1.Text);
fu := form1.memo3.Lines.Count;
i:=1;
for i:=1 to linedo
begin
j:=1;
str2 := '';
str2 := Chr(Random(30) + Ord('A'))+ inttostr(Random(7) + 1);
while j<= num-2do
begin
g:=random(fu);
str2 := str2+'+'+Chr(Random(30) + Ord('A'))+inttostr(Random(7) + 1);
j := j+1;
Sleep(0);
end;
ss.Add(str2) ;
end;
tmps.Text := ss.Text;
ss.Free;
end;
//主窗口调入
procedure TForm1.Button1Click(Sender: TObject);
var
newthread : TTestThread1;
begin
newthread := TTestThread1.Create(false);
end;
//出现的错误 窗口句柄是非法的?