I think you are going to need two passes since you imply you cannot insure the order of the array.
In reply to Re^3: Replace a value with another value from the same array
by huck
in thread Replace a value with another value from the same array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |