Sign in Join

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

Mailing lists / fpc-pascal / 2023-05

Multiple enumerators per class

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Hairy Pixels

Is it possible to have multiple enumerators on one class?

Regards,
Ryan Joseph

Marco van de Voort
to Hairy Pixels

Op 12/05/2023 om 14:16 schreef Hairy Pixels via fpc-pascal:

Is it possible to have multiple enumerators on one class?

Yes, see e.g. TDictionary that allows iterations over keys and values and both. There is only one default iterator, but you can have some property that has its own iterator.

Hairy Pixels
to Marco van de Voort
Show quoted text 6 lines
On May 12, 2023, at 7:24 PM, Marco van de Voort via fpc-pascal wrote: Op 12/05/2023 om 14:16 schreef Hairy Pixels via fpc-pascal: > Is it possible to have multiple enumerators on one class? Yes, see e.g. TDictionary that allows iterations over keys and values and both. There is only one default iterator, but you can have some property that has its own iterator.

Where is TDictionary located so I can see the class definition? can't seem to find it....

Regards,
Ryan Joseph

Thomas Kurz
to Hairy Pixels

It's part of generics.collections and located in fpc\3.2.2\source\packages\rtl-generics\src\*

Earlier message 20 lines
----- Original Message ----- From: Hairy Pixels via fpc-pascal To: FPC-Pascal users discussions Sent: Friday, May 12, 2023, 14:59:11 Subject: [fpc-pascal] Multiple enumerators per class > On May 12, 2023, at 7:24 PM, Marco van de Voort via fpc-pascal wrote: > Op 12/05/2023 om 14:16 schreef Hairy Pixels via fpc-pascal: >> Is it possible to have multiple enumerators on one class? > Yes, see e.g. TDictionary that allows iterations over keys and values and both. There is only one default iterator, but you can have some property that has its own iterator. Where is TDictionary located so I can see the class definition? can't seem to find it.... Regards, Ryan Joseph