Updated: Make Your Own Classes Iterables - Discussion

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 where I first encountered the problem, raised it Latest Blog and Announcement - Folder Contents in a Menu - General - Xojo Programming Forum then the changes needed in Folder Contents in a Menu, Redux – Xojo Programming Blog