Difference between revisions of "LlListSort"

From Second Life Wiki
Jump to navigation Jump to search
 
Line 1: Line 1:
{{LSLFunctionAll|func_id=184|func_sleep=0.0|func_energy=10.0|func=llListSort|return_type=list|p1_type=list|p1_name=src|p2_type=integer|p2_name=stride|p3_type=integer|p3_name=ascending|func_footnote=Sort the list into blocks of stride in ascending order if ascending == TRUE. Note that sort only works between same types.|return_text|spec|caveats|examples|helpers|related|also|notes}}[[Category:LSL_Functions]][[Category:LSL_Stub]]
{{LSL_Function
|func_id=184|func_sleep=0.0|func_energy=10.0
|func=llListSort|return_type=list
|p1_type=list|p1_name=src
|p2_type=integer|p2_name=stride|p2_desc=number of entries per stride, if less then 1 it is assumed to be 1.
|p3_type=integer|p3_name=ascending|p3_desc=if {{LSLG|FALSE}} then the sort order is desending, otherwise the order is assending.
|func_footnote
|func_desc
|return_text=that is '''src''' sorted by '''stride'''.
|spec=The sort order is effected by type.<br/>
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"]
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>
|caveats
|constants
|examples
|helpers
|also_functions
|also_events
|also_tests
|also_articles
|notes
|permission
|negative_index
|sort=ListSort
|cat1=List
|cat2
|cat3
|cat4
}}

Revision as of 08:30, 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. <lsl> 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"] </lsl>

Examples

Deep Notes

Search JIRA for related Issues

Signature

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