Difference between revisions of "LlListSort"

From Second Life Wiki
Jump to navigation Jump to search
Line 10: Line 10:
|spec=The sort order is effected by type.<br/>
|spec=The sort order is effected by type.<br/>
Each type is sorted individually and then feathered to have the same order of types.
Each type is sorted individually and then feathered to have the same order of types.
<lsl>llListSort([1, "C", 3, "A", 2, "B"], 1, TRUE) == [1, "A", 2, "B", 3, "C"]
<pre>llListSort([1, "C", 3, "A", 2, "B"], 1, TRUE) == [1, "A", 2, "B", 3, "C"]
llListSort([1, 3, 2, "C", "A", "B"], 1, TRUE) == [1, 2, 3, "A", "B", "C"]
llListSort([1, 3, 2, "C", "A", "B"], 1, TRUE) == [1, 2, 3, "A", "B", "C"]


llListSort([1, "C", 3, "A", 2, "B"], 2, TRUE) == [1, "C", 2, "B", 3, "A"]</lsl>
llListSort([1, "C", 3, "A", 2, "B"], 2, TRUE) == [1, "C", 2, "B", 3, "A"]</pre>
|caveats
|caveats
|constants
|constants

Revision as of 08:32, 10 February 2007

Summary

Function: list llListSort( list src, integer stride, integer ascending );

Returns a list that is src sorted by stride.

• list src
• integer stride number of entries per stride, if less then 1 it is assumed to be 1.
• integer ascending if FALSE then the sort order is desending, otherwise the order is assending.

Specification

The sort order is effected by type.
Each type is sorted individually and then feathered to have the same order of types.

llListSort([1, "C", 3, "A", 2, "B"], 1, TRUE) == [1, "A", 2, "B", 3, "C"]
llListSort([1, 3, 2, "C", "A", "B"], 1, TRUE) == [1, 2, 3, "A", "B", "C"]

llListSort([1, "C", 3, "A", 2, "B"], 2, TRUE) == [1, "C", 2, "B", 3, "A"]

Examples

Deep Notes

Search JIRA for related Issues

Signature

function list llListSort( list src, integer stride, integer ascending );