sort - Sort an array.
sort([sort:integer,fname:string] array)
This function sort an array. By default sort will look at the first element to guest the sorting type.
You can specify the sort type to be 0 for integer, 1 for string, 2 for your sort function and 3 for float.
A sort function receive to element and you must compare them.
sort([1.5,5,2,98,32,7,2,5]); return [1.5,2,2,5,5,7,32,98] function f(a,b) return b - a; endf sort(sort:2,fname:"f",[1,5,2,98,32,7,2,5]); return [98,32,7,5,5,2,2,1] sort([1,5,2,98,32,7,2,5]); }}. return [1,2,2,5,5,7,32,98] sort(sort:0,[1,5,2,98,32,7,2,5]); }} return [1,2,2,5,5,7,32,98] sort(sort:1,['gt','ab', 'ba', 'cd']); return ["ab","ba","cd","gt"]
Written by Pierre Laplante, <laplante@sednove.com>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
1.0 2014-09-09 21:24:14 laplante@sednove.com