D
dong511
Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下,//ShowMessage(IntToStr(length(s)));我把这句话不屏蔽的话可以执行下面的IF语句,屏蔽了就执行不了IF语句,是什么原因,谢谢!!! procedure TTelServerMainForm.ComPort1Trigger(CP: TObject; Msg, TriggerHandle, Data: Word); var I : Word; C : Char; s,ALogFile : String; ilen: Integer; begin try case Msg of APW_TRIGGERDATA : {got 'login', send response} ; APW_TRIGGERAVAIL : {extract and display/process the data} begin s:=''; for I:= 1 to Data do begin C := ComPort1.GetChar; s:=s+c; end; //ShowMessage(IntToStr(length(s))); if length(s) > 8 then begin //添加到日志列表里 ALogFile := 'telinfo.txt'; AddLogToFile(ALogFile,s); Diff(s); end; end; APW_TRIGGERTIMER : {timed out waiting for login prompt, handle error} ; end; except end; end;