⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 workthread.pas.~13~

📁 自助公交信息短信服务平台
💻 ~13~
字号:
unit workthread;

interface

uses
  Classes,Messages;

type
 //发送线程
 TWorkThread = class(TThread)
  private
    { Private declarations }
    procedure ManagerDev;   // the gate for the whole thread
          //to send msg
    procedure Workt;                     //to receive msg
    protected
    procedure Execute; override;     //重载执行函数
   // procedure Create;override;
  public
   // constructor create;

  end;
  var
         recvcounts:integer;
        Sendcounts:integer;
         TestFlag:Boolean;
implementation

uses
  SysUtils,calldll, mainProfile;

{ 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 TSendThread.UpdateCaption;
    begin
      Form1.Caption := 'Updated in a thread';
    end; }

{ TSendThread }
procedure TWorkThread.Execute;       //thread can run here
begin
  { Place thread code here }
   //while not Terminated do
    TestFlag:=true;
    recvcounts:=0;
    Sendcounts:=0;
        Form1.StatusBar2.Panels[1].Text:='开始自动回复...';
   
  //  while TestFlag=true do
   begin
     sleep(1000);
     ManagerDev;
     Form1.StatusBar2.Panels[1].Text:='正在自动回复处理...';
   end;
   
end;

procedure TWorkThread.ManagerDev;    //system para
begin

  while TestFlag=true do
  begin
     Workt;  
   end;
   //SendMsg;   //first test receive thread
end;
procedure TWorkThread.Workt;
begin
Form1.transgrid32grd1;
end;
end.

⌨️ 快捷键说明

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