You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
The text was updated successfully, but these errors were encountered:
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;
The text was updated successfully, but these errors were encountered: