"Komag" wrote:
...
EDIT - I tested using FOR i = 0 TO in both FOR loops, and there is no problem, even with each using the same variable "i", so it's only when using FOR EACH and thus it uses Roku's internal counter system somehow.
Correct. Each object that implements ifEnum (the enumeration interface) maintains a single internal position pointer. The 'for each' loop just initializes, checks, and advances that position via the object's ifEnum API. If you nest 'for each' loops on the same object, or call the ifEnum interface directly in-between, you will not get the 'expected' behavior.
While I would agree it's not intuitive, and I don't recall any clear documentation or examples off the top of my head, it's "always" worked that way.
And it's been discussed in this forum, I'm sure many years ago though, so I'm not going to go looking for it
😉I encourage you to file a documentation enhancement request as well.