multi-level-sort function
multi-level-sort: func [
"Returns a copy of the block, sorted on the given items (all ascending)"
block [any-block!]
offsets [any-block!]
/local idx result
][
idx: make block length? block
repeat i length? block [
append idx append/only reduce [i] excerpt block/:i offsets
]
sort/skip/compare idx 2 2
result: make block length? block
foreach [index data] idx [
append/only result block/:index
]
result
]