sort_pairs( : : T1, T2, SortMode : Sorted1, Sorted2)
描述
Sort tuple pairs.
This procedure first sorts one of the tuples (which one is specified by the parameter SortMode) in ascending order. The second tuple is then ordered such, that their position in the output tuple is the same as the new position of the value of the first tuple, which had the same index before sorting.
Example:
Tuple1 := [5,4,3,2,1]
Tuple2 := [105,204,303,402,501]
sort_pairs (Tuple1, Tuple2, '1', Sorted1, Sorted2)
returns:
Sorted1 := [1,2,3,4,5]
Sorted2 := [501,402,303,204,105]