Das gefällt mir nicht so:
Delphi-Quellcode:
procedure TForm1.Button3Click(Sender: TObject);
var s:ansistring;
begin
comPort1.Write(pchar(edit1.Text),1);
comport1.Write(#13,1);
s := ansistring(edit2.Text);
comport1.WriteStr(s);
comport1.Write(#13,1);
end;
Besser so:
Delphi-Quellcode:
procedure TForm1.Button3Click(Sender: TObject);
var line:ansistring;
begin
line := AnsiString(edit1.Text + #13);
comport1.WriteStr(line);
line := AnsiString(edit2.Text + #13);
comport1.WriteStr(line);
end;