Should it be possible to duplicate a list whilst iterating that list?

Obviously it's not possible to edit a list whilst iterating around it and also you can't iterate around it again within a sub for each, so I am duplicating lists in order to be able to achieve these things, however that generates the error: "Duplicate is not a valid operation inside a StartIteration/EndIteration block".

I read in the forum that this should be possible and I know that there was a bug surrounding this error that was recently fixed, so I upgraded to the latest version but it still doesn't work.  Should this actually be possible or is the error a genuine one and I have to duplicate at a higher level?

Hi Sienna,

4 possible solution patterns:

1) itterate the list based in index and List.Length

2) duplicate the list prior to the iteration, and use the currentrownumber of the list you iterate to update the duplicate list. 

3) iterate the list and append to new list by mapping the current list element to the new list 

4) Use an entity as temporary storage to manipulate the list (performance wise and AO wise not the best solution).

Regards,

Daniel

Ok thanks, I can duplicate at a higher level but just wanted to check whether it was expected behaviour given the 2 aforementioned reasons.  Thanks again.

Sienna