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

Cyrax evvke at hotmail.com
Fri Jul 28 10:07:23 CEST 2017


On 27/07/17 18:17, noreply at z505.com wrote:
> 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
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

AFAIK, that is avaible only in the trunk version of FPC. You need to 
build the trunk version of the documents by yourself.




More information about the fpc-pascal mailing list