Problem:
RTS166 Erorr when using an Iterator on a Dictionary Object
When using the DO method on a Dictionary collection it results in a RTS 166 Recursive Call Error.
Resolution:
This is due to the callback method being used with an alternate ENTRY point in the program. When the iterator calls the entry point it detects a recursive call and terminates with an RTS 166 error.
To use Iterators with an entry point you must have a "local-storage section" in the program. It does not need any data. It just enables the program to be called recursively.