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

noreply at z505.com noreply at z505.com
Thu Jul 27 17:17:51 CEST 2017


On 2017-07-25 11:00, Martok wrote:
>> 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]
> 
> 

The fpc wiki should probably be updated?

I cannot find "insert" on this page:
http://wiki.freepascal.org/Array

I cannot find it here either:
https://www.freepascal.org/docs-html/ref/refsu14.html

For the last 10 years or so I've been criticizing occasionally the fact 
that everyone reinvents their own array algorithms for each array! So it 
seems that may solve it. In fact this problem goes back to the 1970's 
and 1980's when arrays were being used.

Please list other functions other than insert that are available? Maybe 
someone add it to the wiki/docs



More information about the fpc-pascal mailing list