tchou.pas

来自「delphi2007 开发的一个抽奖系统(带源代码)」· PAS 代码 · 共 61 行

PAS
61
字号
unit TChou;

interface

uses
  Classes,SysUtils,math;

type
  DispCJ = class(TThread)
  private
    { Private declarations }

     public
      k:integer;
  protected
    procedure Execute; override;

  end;

implementation

uses main;

{ Important: Methods and properties of objects in visual components can only be
  used in a method called using Synchronize, for example,

      Synchronize(UpdateCaption);

  and UpdateCaption could look like,

    procedure DispCJ.UpdateCaption;
    begin
      Form1.Caption := 'Updated in a thread';
    end; }

{ DispCJ }

procedure DispCJ.Execute;
 var
  i,q:integer;
begin
  { Place thread code here }

  while form1.bz  do
  begin
    //取随机数
    q:=form1.Memo1.Lines.Count ;
    Randomize;
    i:=RandomRange(0,q);
     k:=i;
     form1.Edit2.Text := form1.Memo1.Lines.Strings[i];
     form1.Memo2.Lines.Append(form1.Memo1.Lines.Strings[i]);
     form1.Memo2.Update;
     sleep(10);
  end;
end;



end.

⌨️ 快捷键说明

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