-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
String converting lost data after #0 symbol
You can't get #0 from port....
property Buffer: string read FBuffer write FBuffer; <<<<<<<<<<<< Here!
procedure TComDataPacket.RxBuf(Sender: TObject; const Buffer; Count: Integer);
var sa:AnsiString; Str: string;
i:Integer;
begin
SetLength(Str, Count);
SetLength(Sa, Count);
Move(Buffer, Sa[1], Count);
{$IFDEF Unicode}
if Length(sa)>0 then
for i := 1 to Length(sa) do Str[i] := char(Byte(sa[i]));
{$ELSE} Str := sa; {$ENDIF} <<<<<<<<<<<< Here!
AddData(Str);
end;
// add custom data to packet buffer
procedure TComDataPacket.AddData(const Str: string);
begin
if ValidStop then
begin
Buffer := Buffer + Str; <<<<<<<<<<<< Here!
HandleBuffer;
end
else
DoPacket(Str);
end;
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels