在它的ReceiveData接收事件将读取的bufferlength存为字符串
type
IArr = ^integer;
var
RevP : array [1..4096] of byte;
i : integer;
CommRevStr : ShortString;
begin
SetLength(CommRevStr,BufferLength);
Move(IArr(buffer)^,Revp,bufferLength);
For i:=1 to BufferLength do
begin
CommrevStr := Char(Revp);
end;
edit1.text:=commrevStr;
end;