# Updated: Make Your Own Classes Iterables - Discussion

**URL:** <https://forum.xojo.com/t/updated-make-your-own-classes-iterables-discussion/65367>\
**Category:** General\
**Created:** [September 2, 2021, 11:11pm UTC](https://forum.xojo.com/t/updated-make-your-own-classes-iterables-discussion/65367 "2021-09-02T23:11:14Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [September 2, 2021, 11:11pm UTC](https://forum.xojo.com/t/updated-make-your-own-classes-iterables-discussion/65367/1 "2021-09-02T23:11:14Z")

</div>

Continuing the discussion from [Updated: Make Your Own Classes Iterables](https://forum.xojo.com/t/updated-make-your-own-classes-iterables/65364):

I’m not sure if this was intended or not, but the downloadable example project is the API 1.0 edition and doesn’t match the article.

> [@](#):
>
> What are the main differences when comparing `For Each… Next` with the conventional `For… Next`?

Another main difference is that you cannot continue through the loop if an exception is raised, unlike when using For… Next, see \<[https://xojo.com/issue/63699](https://xojo.com/issue/63699)\>

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [September 3, 2021, 3:29am UTC](https://forum.xojo.com/t/updated-make-your-own-classes-iterables-discussion/65367/2 "2021-09-03T03:29:35Z")

</div>

Just looking at the description of the Feedback case and the example. What is supposed to happen in the example? I clicked on the button… and nothing happened. Ok, so c:windows isn’t the best starting point for macOS. But even with specialFolder.Applications as starting point: what should I see?

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [September 3, 2021, 3:36am UTC](https://forum.xojo.com/t/updated-make-your-own-classes-iterables-discussion/65367/3 "2021-09-03T03:36:08Z")

</div>

You’ll only encounter the problem if a file in your search path isn’t accessible at which point an exception is thrown that you can’t iterate past, hence iterables being of limited use when exceptions are encountered.

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [September 3, 2021, 4:01am UTC](https://forum.xojo.com/t/updated-make-your-own-classes-iterables-discussion/65367/4 "2021-09-03T04:01:31Z")

</div>

Still confused. Isn’t that the purpose of the try/catch? And how does that differ from not using an iterable? What does “isn’t accessible” mean?

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [September 3, 2021, 4:14am UTC](https://forum.xojo.com/t/updated-make-your-own-classes-iterables-discussion/65367/5 "2021-09-03T04:14:04Z")

</div>

> [@Beatrix\_Willius](#):
>
> What does “isn’t accessible” mean?

In the example, it would be a file that doesn’t have correct privileges to access it, or the file has been (re)moved since the directory listing was obtained and the iterator hit the file.

If the internals of the iteration raise an exception, you cannot skip and carry on. If you break the iteration out into a standard for loop, you can indeed use try/catch as you can handle the skip and carry on yourself, thus rendering the use of iteration limited.

See [Folder Contents in a Menu – Xojo Programming Blog](https://blog.xojo.com/2021/02/23/folder-contents-in-a-menu/) where I first encountered the problem, raised it [Latest Blog and Announcement - Folder Contents in a Menu - General - Xojo Programming Forum](https://forum.xojo.com/t/latest-blog-and-announcement-folder-contents-in-a-menu/61424) then the changes needed in [Folder Contents in a Menu, Redux – Xojo Programming Blog](https://blog.xojo.com/2021/02/24/folder-contents-in-a-menu-redux/)

---

<div class="post-metadata">

**Author:** ![RudolfJ](https://forum.xojo.com/user_avatar/forum.xojo.com/rudolfj/32/644_2.png) [@RudolfJ](https://forum.xojo.com/u/RudolfJ)\
**Post date:** [September 3, 2021, 9:40am UTC](https://forum.xojo.com/t/updated-make-your-own-classes-iterables-discussion/65367/6 "2021-09-03T09:40:37Z")

</div>

Hi there,  
i’m making it a little easier a class as a record and an array as a list for the output old programming

[https://www.dropbox.com/s/xipev1kqifzcot6/Record-test.xojo\_binary\_project?dl=1](https://www.dropbox.com/s/xipev1kqifzcot6/Record-test.xojo_binary_project?dl=1)

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [September 3, 2021, 10:32am UTC](https://forum.xojo.com/t/updated-make-your-own-classes-iterables-discussion/65367/7 "2021-09-03T10:32:01Z")

</div>

> [@RudolfJ](#):
>
> i’m making it a little easier a class as a record and an array as a list for the output old programming

Is this related to the topic?

---

<div class="post-metadata">

**Author:** ![Sascha\_S](https://forum.xojo.com/user_avatar/forum.xojo.com/sascha_s/32/22328_2.png) [@Sascha\_S](https://forum.xojo.com/u/Sascha_S)\
**Post date:** [September 3, 2021, 10:54am UTC](https://forum.xojo.com/t/updated-make-your-own-classes-iterables-discussion/65367/8 "2021-09-03T10:54:28Z")

</div>

> [@anon20074439](#):
>
> you can indeed use try/catch as you can handle the skip and carry on yourself,

I would say this is the correct way to handle such a situation. Am i wrong?

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [September 3, 2021, 11:21am UTC](https://forum.xojo.com/t/updated-make-your-own-classes-iterables-discussion/65367/9 "2021-09-03T11:21:39Z")

</div>

No, you are not wrong. As the article was revisited I thought it pertinent to mention.

---

<div class="post-metadata">

**Author:** ![Arnaud\_N](https://forum.xojo.com/user_avatar/forum.xojo.com/arnaud_n/32/21824_2.png) [@Arnaud\_N](https://forum.xojo.com/u/Arnaud_N)\
**Post date:** [September 3, 2021, 4:31pm UTC](https://forum.xojo.com/t/updated-make-your-own-classes-iterables-discussion/65367/10 "2021-09-03T16:31:31Z")

</div>

There’s something else I quite don’t get in the announcement.

Why would one add and use an iterator to get the addresses when it’s simply doable with “for each Address as PostalAddress in ThisPerson.Addresses”, since ThisPerson.Addresses is already an array (so, iterable)?
