With your previous help I have managed to get my app working in the main,
but I have encountered a couple of problems. I am using a serial to ethernet
box to convert legacy serial data to transport of IP. All the data is
terminated CRLF. Some of the data is provided on a single line string and
some on multiple lines.
The problem I have is a richedit box on my form throws up an error when I
set the recvstring time to high, but the stuff with multiple strings does
not process it's data properly if the timer is to low.
Should I try something else? I do not need to update the richedit I just
like to see what is going on.
code
=================================================
{***********************************************
Process calls for port1
***********************************************}
procedure TTCPRecvThrd1.Execute;
var
// s: string;
LCmd: string;
MyDataParse1 : pMyDataParse1;
begin
sock:=TTCPBlockSocket.create;
try
Sock.socket:=CSock;
sock.GetSins;
with sock do
begin
repeat
if terminated then break;
LCMD := RecvString(60);
if lastError<>0 then break;
SendString(LCmd+#13#10);
New(MyDataParse1);
MyDataParse1.IPDataString := LCmd;
PostMessage(Form1.Handle, WM_MyDataParse1, 0,
integer(MyDataParse1));
if lastError<>0 then break;
until false;
end;
finally
Sock.Free;
end;
end;
{*****************************************************
Receive Data from Thread 1
******************************************************}
procedure TForm1.WMMyDataParse1(var Message: TMessage);
var
CallString,p: String;
EndStr, StrCheck: integer;
begin
p := pMyDataParse1(Message.LParam).IPDataString;
Dispose(pMyDataParse1(Message.LParam));
Regex1 := TPerlRegEx.Create(nil);
Regex1.RegEx := RegExpStr1;
Regex1.Subject := p;
if Regex1.Match then begin
StrCheck := 1;
if RegExpEnd1 = '1' then begin
EndStr := 1;
StrCheck := 0;
end
else
Endstr := 0;
StrCheck :=1;
end;
if RegExpEnd1 <> '1' then begin
Regex1.RegEx := RegExpEnd1;
Regex1.Subject := p;
if Regex1.Match then begin
EndStr := 1;
StrCheck := 0;
end
else begin
EndStr := 0;
StrCheck := 1;
end;
end;
if EndStr = 1 then begin
sysStr1 := sysStr1+p;
richedit1.Lines.Append(sysStr1);
CallString := CallConv(sysStr1,PhonesysID1);
CallString := CallString+',1,1';
richedit1.Lines.Append(CallString);
ProcessSearch2(CallString);
EndStr := 0;
SysStr1 := '';
StrCheck := 0;
end
else begin
if StrCheck = 1 then
SysStr1 := SysStr1+p+#13#10;
end;
end;
=================================================================
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public