Updated: Make Your Own Classes Iterables

Originally published at: https://blog.xojo.com/2021/09/02/updated-make-your-own-classes-iterables/

In programming, iterators are the mechanisms that allow us to run through all the items of a collection without needing to know in advance how many of them compose that collection. To do this, we can use the commands For Each… Next in Xojo. What are the main differences when comparing For Each… Next with the conventional For… Next? See how the For Each… Next loop iterates every item associated with the object. It’s a more concise, stylish and Object-Oriented (OOP) way of doing things when compared with the classic For… Next loop.

5 Likes