?? smg_reportthread.~pas
字號:
unit SMG_ReportThread;
interface
uses
Classes, SP_SMG_DLL, SysUtils;
type
TReport_Thread = class(TThread)
private
ReportBuf : ReportStr;
procedure Report;
{ Private declarations }
protected
procedure Execute; override;
public
constructor Create(FReport: ReportStr; CreateSuspended: Boolean);
end;
implementation
{ 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 TReport_Thread.UpdateCaption;
begin
Form1.Caption := 'Updated in a thread';
end; }
{ TReport_Thread }
uses SPServer, SMG_DB;
procedure TReport_Thread.Execute;
begin
{ Place thread code here }
FreeOnTerminate := True;
Report;
end;
constructor TReport_Thread.Create(FReport : ReportStr; CreateSuspended: Boolean);
begin
ReportBuf := FReport;
FreeOnTerminate := True;
inherited Create(CreateSuspended);
end;
procedure TReport_Thread.Report;
var
pSeqNum1,pSeqNum2,pSeqNum3:LongInt;
pSrcNo,pState,pErrCode:string;
begin
with ReportBuf do
begin
pSeqNum1:=SequenceNumber1;
pSeqNum1:=SequenceNumber2;
pSeqNum1:=SequenceNumber3;
pSrcNo:=UserNumber;
pState:=State;
pErrCode:=ErrCode;
end;
with frmSGIP do
begin
CurLogMsg(TRE,'序列號1:'+IntToStr(pSeqNum1));
CurLogMsg(TRE,'序列號2:'+IntToStr(pSeqNum2));
CurLogMsg(TRE,'序列號3:'+IntToStr(pSeqNum3));
CurLogMsg(TRE,'用戶號碼:'+pSrcNo);
CurLogMsg(TRE,'狀態:'+pState);
CurLogMsg(TRE,'錯誤代碼:'+pErrorCode);
end;
with frmSMGDB.tblReport do
begin
Open;
Insert;
Fields[1].Value:=pSeqNum1;
Fields[2].Value:=pSeqNum2;
Fields[3].Value:=pSeqNum3;
Fields[4].Value:=pSrcNo;
Fields[5].Value:=pState;
Fields[6].Value:=pErrCode;
Post;
Close;
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -