Using For Each with Controls

Is there a way to use For Each to cycle through the rows of a list box or lines in a text area? I’ve noticed that most of the built-in controls that have collections (rows, lines, items, etc.) are not IEnumerable which makes no sense to me. I find that For Each loops tend to look cleaner than For…Next loops and I don’t have to know the number of items in the collection.

Keep in mind that per the documentation you can’t expect any kind of order with a for ... each so things where order is integral you need to use a for ... next whether you like it or not.

Most of the time I’m not concerned with the order of the items in the collection. I just want to iterate through them one at a time, do whatever check or test I need to do and then move to the next.

I admit my frustration level is pretty high with Xojo. As much as I like it I keep bumping my head against these types of limitations. Coming from a 7 year C# background I’ve grown to like the simplicity of Xojo as compared to .NET but I’ve also learned to really appreciate the flexibility and power offered by the .NET framework.

Thanks for the response.

Sorry, was just trying to help prevent an issue before it became an issue. If things are missing from the framework that you’d like to see, file a feedback report!

You were helpful. :slight_smile: I’m learning to work within the framework that currently exists for Xojo.

You could write feature requests and maybe they can add it for next time they refresh it.