unit2.~pas

来自「example of security system」· ~PAS 代码 · 共 50 行

~PAS
50
字号
unit Unit2;

interface

uses
  Classes, SysUtils;

type
  tSender = class(TThread)
  private
    { Private declarations }
  protected
    procedure Execute; override;
  public
    n:integer;
    slp: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 tSender.UpdateCaption;
    begin
      Form1.Caption := 'Updated in a thread';
    end; }

{ tSender }

procedure tSender.Execute;
begin
  { Place thread code here }
  repeat
   inc(Form1.s);
   if form1.f>form1.n then
    form1.f:=1;
   form1.a[form1.f]:=n;
   sleep(slp);
  until terminated;
end;

end.
 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?