1. Sorting by nth element of a sequence
- Posted by Derek Brown <Cyrusbrown at AOL.COM>
Jun 18, 1999
-
Last edited Jun 19, 1999
How do I sort by the nth element of a sequence? I need to sort about 50
sequences by the 5th element.
Thanks,
Derek Brown
2. Re: Sorting by nth element of a sequence
- Posted by Irv Mullins <irv at ELLIJAY.COM>
Jun 18, 1999
-
Last edited Jun 19, 1999
On Fri, 18 Jun 1999, you wrote:
> How do I sort by the nth element of a sequence? I need to sort about 50
> sequences by the 5th element.
>
Use custom_sort()
example:
integer comp5
function compare_5th(sequence a, sequence b)
return compare(a[5],b[5])
end function
comp5 = routine_id("compare_5th")
mydata = custom_sort(comp5,mydata)
Irv