Re: [fpc-pascal] Size of set.

2023-05-23 Thread Bart via fpc-pascal
On Tue, May 23, 2023 at 2:14 AM Mikael Backman via fpc-pascal wrote: > Is there any way to decide the number of elements in a set? > there any way to traverse the elements in a set? Couldn't you use PopCnt for that? You would need to know the SizeOf() the type of the set in question. --

Re: [fpc-pascal] Size of set.

2023-05-23 Thread Mattias Gaertner via fpc-pascal
On Tue, 23 May 2023 06:50:08 -0400 James Richters via fpc-pascal wrote: > >You can transverse a set with > > for ... in An even better: for e in TEnum do ; // traverse every possible enum for e in aSet do ; // traverse only enums in aSet > Interesting, I learned something new, I did

Re: [fpc-pascal] Size of set.

2023-05-23 Thread James Richters via fpc-pascal
>You can transverse a set with > for ... in Interesting, I learned something new, I did now know I could do this with FreePascal. It says it works for Strings and Arrays as well, does it also work for StringLists? James ___ fpc-pascal maillist

Re: [fpc-pascal] Size of set.

2023-05-23 Thread Peter B via fpc-pascal
On 23/05/2023 01:14, Mikael Backman via fpc-pascal wrote: Hi, basic questions here. Is there any way to decide the number of elements in a set?  there any way to  traverse the elements in a set? Regards Mikael ___ fpc-pascal maillist -

[fpc-pascal] Size of set.

2023-05-22 Thread Mikael Backman via fpc-pascal
Hi, basic questions here. Is there any way to decide the number of elements in a set? there any way to traverse the elements in a set? Regards Mikael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org