Re: [fpc-pascal] Pre-allocated TFPGList or similar

2019-11-24 Thread Ryan Joseph via fpc-pascal
> On Nov 24, 2019, at 3:57 AM, Sven Barth via fpc-pascal > wrote: > > What you're looking for is the Count property. Setting it is supported by the > untyped lists in Classes, the generic ones in FGL as well as those in > Generics.Collections. > > === code begin === > > list :=

[fpc-pascal] Variant part in objects?

2019-11-24 Thread Ryan Joseph via fpc-pascal
Is there a reason that objects don't support variant sections like with records? Maybe they mess with the VMT table when virtual methods are added? I just posted my "advanced objects" patch (https://bugs.freepascal.org/view.php?id=36350) and all it does is add "class operators" to objects but

Re: [fpc-pascal] Pre-allocated TFPGList or similar

2019-11-24 Thread Michael Van Canneyt
On Sun, 24 Nov 2019, Sven Barth via fpc-pascal wrote: Am 24.11.2019 um 10:14 schrieb Michael Van Canneyt: On Sun, 24 Nov 2019, Sven Barth via fpc-pascal wrote: Am 23.11.2019 um 23:42 schrieb Ryan Joseph via fpc-pascal: I need a pre-grown list which I can put (not insert!) items into at

Re: [fpc-pascal] Pre-allocated TFPGList or similar

2019-11-24 Thread Sven Barth via fpc-pascal
Am 24.11.2019 um 10:14 schrieb Michael Van Canneyt: On Sun, 24 Nov 2019, Sven Barth via fpc-pascal wrote: Am 23.11.2019 um 23:42 schrieb Ryan Joseph via fpc-pascal: I need a pre-grown list which I can put (not insert!) items into at indexes without getting "List index out of bounds"

Re: [fpc-pascal] Pre-allocated TFPGList or similar

2019-11-24 Thread Michael Van Canneyt
On Sun, 24 Nov 2019, Sven Barth via fpc-pascal wrote: Am 23.11.2019 um 23:42 schrieb Ryan Joseph via fpc-pascal: I need a pre-grown list which I can put (not insert!) items into at indexes without getting "List index out of bounds" errors. For example I want to start with a list that has 10

Re: [fpc-pascal] Pre-allocated TFPGList or similar

2019-11-24 Thread Sven Barth via fpc-pascal
Am 23.11.2019 um 23:42 schrieb Ryan Joseph via fpc-pascal: I need a pre-grown list which I can put (not insert!) items into at indexes without getting "List index out of bounds" errors. For example I want to start with a list that has 10 empty indexes: list := TList.Create(10); // 10 empty