[fpc-pascal] Concat TCollection?

Michael Van Canneyt michael at freepascal.org
Sun May 3 11:04:06 CEST 2020

On Sun, 3 May 2020, Ryan Joseph via fpc-pascal wrote:

> I have many TCollection's that I need to concat together into one larger collection for streaming. Since it's just a list I thought I could add the elements together but it appears TCollection requires that it allocate each item.
> Is there a way to do this without relocating each item of the collection? There could be 10000+ items so it's important that I reuse the existing collections.

Just set the Collection property of the items to the concatenated collection instance.

Note that this effectively moves the items.


More information about the fpc-pascal mailing list