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

Sven Barth pascaldragon at googlemail.com
Thu Jul 27 17:22:10 CEST 2017


Am 27.07.2017 17:18 schrieb <noreply at z505.com>:
>
> 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

Then update it.

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

The documentation is always for the latest release (currently 3.0.2, soon
3.0.4), but only trunk supports this as well as Delete() (Concat() is not
yet implemented however).

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170727/71c14f14/attachment.html>


More information about the fpc-pascal mailing list