There are two ways to implement an array in variables. You've described one. The other approach is to build a return separated list of values in one repetition of a variable. With that approach, you can use getValue to extract a specific list element and ValueCount will tell you the number of elements in your array.
If you prefer repetitions, you'll need to associate a second variable with it that stores the number of elements and then update it each time you append/remove elements from the array.
PS. I'll be interested to see how this approach works for you--especially with tables that have very large numbers of records. I would think you'd take a significant performance hit with this approach, but could be wrong.
The processing is meant to work on either new records or a very limited found set. The array is simply a way to loop through the processing of multiple tables from a single set of values.
I have used a similar scheme to replace values but I simply looped through a processing table constructed based on a value list choice in that case. I just figuered I could bypass writing out the processing table by using array variables.