[fpc-pascal] Best way to insert bytes into a TBytes variable?

Martok listbox at martoks-place.de
Tue Jul 25 18:00:21 CEST 2017


> Ideally the function should be portable between FPC and Delphi XE5...
You'd only need your own functions for Delphi, FPC's intrinsics such as Insert()
can already work with arrays:

var
  b, c: TBytes;
begin
  b:= TBytes.Create(1,2,3);
  c:= TBytes.Create(10,11);
  Insert(c,b,2);

-> b is now [1,2,10,11,3]


--
Martok




More information about the fpc-pascal mailing list