Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2023-05

Size of set.

5 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mikael Backman

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

Reply by email

James Richters
to Peter B
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

Reply by email

Mattias Gaertner
to James Richters
>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 now know I could do this with FreePascal. It says it works for Strings and Arrays as well, does it also work for StringLists?

Yes

Mattias

Reply by email