📄 unit3.pas
字号:
unit Unit3;
interface
uses
Classes, SysUtils,windows;
type
tServer = class(TThread)
private
{ Private declarations }
protected
procedure Execute; override;
public
n:integer;
end;
implementation
uses Unit1;
{ Important: Methods and properties of objects in VCL or CLX can only be used
in a method called using Synchronize, for example,
Synchronize(UpdateCaption);
and UpdateCaption could look like,
procedure tServer.UpdateCaption;
begin
Form1.Caption := 'Updated in a thread';
end; }
{ tServer }
procedure tServer.Execute;
var i:word;
t:integer;
d:word;
a:array of word;
label exit;
begin
{ Place thread code here }
setlength(a,n+1);
for i:=1 to n do
begin
a[i]:=0;
end;
repeat
if form1.s<>form1.F then
begin
inc(form1.s);
if form1.s>form1.sz then
form1.S:=1;
d:=GetTickCount();
t:=form1.a[form1.S];
form1.strng:=d-a[t];
a[t]:=d;
form1.k:=t;
form1.r[t]:=d;
synchronize(form1.sedit);
end;
until terminated;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -