0--1--2--3--4--5--6--7--8--9 Index
-----------------------------
89-61-49-92-35-37-86-39-12-64 Variable (random) ArrayA
12-35-37-39-49-61-64-86-89-92 Variable (sorted) ArrayB
09-06-05-10-02-03-08-04-01-07 ID ArrayID
+ ArrayB: For each element
++ ArrayA: For each element
+++ ArrayA: Value at ArrayA.CurrentX Equal to ArrayB.CurrentValue
---> ArrayID: Set index ArrayB.CurrentX to ArrayA.CurrentX
1) Array indices in Construct are 1-based (first index is 1)
2) Copy ArrayA to ArrayB after having generated the random numbers and sort ArrayB. A simple bubble sort algorithm will do.
3) After setting ArrayID, it will look exactly as pictured above. You now have a double reference (both index and ID) and can find either the ID from a value, a value from an ID, an index from an ID, an ID from an index, an index from a value or a value from an index. Just peek at the right positions of the appropriate arrays.
4) The events posted above will only work, if the random generated numbers are unique! 3-1-7-4 will work, 3-3-4-4 will not.