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

Michael Van Canneyt michael at freepascal.org
Wed Aug 16 11:22:41 CEST 2017



On Wed, 16 Aug 2017, Graeme Geldenhuys wrote:

> On 2017-07-25 09:54, Bo Berglund wrote:
>> buffer in an old application, so I need to write efficient
>> replacements for certain string functions (Delete, Insert, Copy etc).
>> 
>> Now I am wondering if there is a better way to do the Insert() command
>> than this:
>
>
> Reading that... All I can think of is the 1000's of Linked-List 
> implementations I had to implement when I was studying Turbo Pascal all 
> that years ago. Delete, Insert and Copy would be so easy to do. :-)
>
>
> What does TBytes use internally to store its data?

It is an array. Hence a continuous block of memory.

Michael.



More information about the fpc-pascal mailing list