Sorts the items in a list.
<list>
none
Name | Type | Description |
---|---|---|
ascending | boolean | Optional. True for ascending order, false for descending order. |
alphabetic | boolean | Optional. True for alphabetic sorting, false for numeric sorting. |
This function sorts the items in a list. By default, items are sorted according to alphabetically in ascending order. Optional parameters can be specified to sort numerically and by descending order.
The following sorts a list alphabetically in ascending order:
<trial example>
/ onTrialEnd = {list.names.sort();}
</trial>
The following sorts a list numerically in ascending order:
<trial example>
/ onTrialEnd = {list.scores.sort(true, false);}
</trial>
The following sorts a list numerically in descending order:
<trial example>
/ onTrialEnd = {list.topscores.sort(false, false);}
</trial>