//向COMM2发送一行或多行
procedure TForm1.BitBtn1Click(Sender: TObject);
var strSend: String;ok:boolean;
begin
Sleep(10);
strSend:=' ';
for i:= 0 to Memo2.Lines.Count -1 do
BEGIN
IF Memo2.Lines[1]<>' ' THEN
strSend:= Memo2.Lines;
try
一行一行送
ok:=Comm2.WriteCommData(PChar(strSend) , Length(strSend));
except
Showmessage('Comm2发送错误');
end;
END;
end;