Hi there,

I have a ByteArray unit that's pretty extensive.

function toString(Var Item:TByteArray):string
var
  iLen:Integer;
begin
  iLen:=System.Length(Item);
  SetLength(Result,iLen);
  if iLen>0 then
    System.Move(Item[0],Result[1],iLen);
end;

On Sun, Aug 16, 2009 at 12:35 PM, Wimpie Nortje<wimpienor...@gmail.com> wrote:
> Hi all,
>
> I have a lot of byte arrays which contains mostly text but also #0. I am
> looking for functions to manipulate these arrays.
>
> The stuff in strutils are mainly what I need but they operate on strings
> which is not usable to me due to the #0. Are there any such functions in
> FPC?
>
> And while I am onto strings...does anyone know of a quick and easy way to
> convert strings to a byte array. Much like aPchar := PChar(aString)?
>
> Thanks
> Wimpie
> _______________________________________________
> fpc-pascal maillist  -  fpc-pas...@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to