S
sapphire4u
Unregistered / Unconfirmed
GUEST, unregistred user!
mscomm1.InputLen:=1;
发数据
procedure TForm1.Button2Click(Sender: TObject);
begin
memo1.lines.loadfromfile('c:/aaa.txt');
for i:=0 to memo1.lines.Count-1 do
begin
mscomm1.output:=memo1.lines+'+';
sleep(100);
end;
收数据
procedure TForm1.MSComm1Comm(Sender: TObject);
begin
case mscomm1.CommEvent of
comevreceive:
begin
ss:=ss+mscomm1.input;
if mscomm1.Input='+' then
begin
memo1.lines.add(ss);
ss:='';
end;
end;
end;
end;
发数据
procedure TForm1.Button2Click(Sender: TObject);
begin
memo1.lines.loadfromfile('c:/aaa.txt');
for i:=0 to memo1.lines.Count-1 do
begin
mscomm1.output:=memo1.lines+'+';
sleep(100);
end;
收数据
procedure TForm1.MSComm1Comm(Sender: TObject);
begin
case mscomm1.CommEvent of
comevreceive:
begin
ss:=ss+mscomm1.input;
if mscomm1.Input='+' then
begin
memo1.lines.add(ss);
ss:='';
end;
end;
end;
end;