>>The whole array is passed in this case because the DO command passes parameters by reference (unless they are enclosed in the parenthesises).
>
>Yes. You're right. I just read that in the help. However, that's not obvious from the code.
The "not obvious" part is explained by the previous sentence... but then, if it's not obvious to you, then it's not obvious to many.
>There really was no need to pass the array at all. Other code buried 3 and 4 levels deep are accessing other arrays without passing them.
Now that IS bad. Kill it... I mean, refactor.