用Spcomm接收大量数据的问题?
勿为 2004-04-23 03:30:00 我在用Spcomm接收10K的数据时,收到的数据中间部分总是不全,而且有部分顺序颠倒,但用Spcomm发送时,用串口调试器则可以收到全部数据。不知为什么?
procedure TForm1.Comm1ReceiveData(Sender: TObject; Buffer: Pointer;
BufferLength: Word);
var
str :string;
i:integer;
begin
str := '';
fillchar(p,Bufferlength,#0);
move(Buffer^,p,BufferLength);
for I := 1 to BufferLength do // Iterate
begin
str :=str + chr(p[i]);
end; // for
Memo1.Lines.Add(str);
end;