I demonstrated some capabilities of Remobjects to a colleague today. We couldn’t help but notice that Remobjects lists do not support enumerators (version 7.0.69.1081).
So constructs like "for person in personlist do… " do not work.
I very much like enumerators because they make my code cleaner and avoid dumb errors like iterating “from 0 to count”. May I humbly ask to add this feature?
I too would like to see this natively in the code. At the moment I’m using some auto generated class helpers (using the RODL as the source of information) to provide the functionality.
As a newbie I’m probably missing something here, but doesn’t the “for each” construct do this? From the wiki:
For Each
’For each’ can be used to iterate over anything that implements the IEnumerable interface. ‘For each’ uses this syntax:
for each el: String in mylist do
for each matching el: String in mylist do
for each el in mylist do
for el in mylist do
In the first two cases the variable is typed, if it’s not typed the type is inferred from the IEnumerable (it will fail if it can’t). The matching keyword will only execute the loop for values that really are of that type, so it will skip any non-strings. In the last case the ‘each’ keyword is left out, which is optional. The ‘for each’ is skipped completely if the value after in is nil.