LlListSort
De DigiWiki.
A slow bubble sort is employed to perform the sort. The sort order is affected by type and is case sensitive.
llListSort(["a", "B", "C", "d", "e"], 1, TRUE) // returns ["B", "C", "a", "d", "e"]
Each type is sorted individually and then feathered to have the same order of types.
llListSort([1, "C", 3, "A", 2, "B"], 1, TRUE) // returns [1, "A", 2, "B", 3, "C"] llListSort([1, 3, 2, "C", "A", "B"], 1, TRUE) // returns [1, 2, 3, "A", "B", "C"] llListSort([1, "C", 3, "A", 2, "B"], 2, TRUE) // returns [1, "C", 2, "B", 3, "A"] llListSort(["2ae", "ah5", "1ag", "aa6", "3ac", "ad7", "ab8", "4af", "ai9"], 1, TRUE); // returns ["1ag", "2ae" ,"3ac" ,"4af" ,"aa6" ,"ab8" ,"ad7" ,"ah5" ,"ai9"]
list numbers = [3, "three", 2, "two", 1, "one"]; default { state_entry() { llOwnerSay(llDumpList2String(numbers, ",")); // Object: 3,three,2,two,1,one numbers = llListSort(numbers, 2, TRUE); llOwnerSay(llDumpList2String(numbers, ",")); // Object: 1,one,2,two,3,three } }