[Array->Sort] reorders the elements of the array in alphabetical or numerical order. Accepts a single boolean parameter. Sorts in ascending order by default or if the parameter is True and in descending order if the parameter is False.
Note: Only string, integer, or decimal values should be sorted. If an array contains arrays or maps then the results of sorting the array are undetermined. Pairs will be sorted by their first element (which should be either a string, integer, or decimal value).
[Array->(Sort: Sort Order)]
Use the [Array->Sort] tag. The following example sorts the items in an array of the days of the week and outputs the sorted array.
<?LassoScript
Variable: 'DaysOfWeek'=(Array: 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
Output: $DaysOfWeek->(Sort: True);
Output: $DaysOfWeek;
?>
(Array: (Fri), (Mon), (Thu), (Tue), (Sat), (Sun), (Wed))
Tag Link | [Array->Sort] | Category | Array |
---|---|---|---|
Type | Member | Data Source | Any |
Support | Preferred | Version | 5.0 |
Output Type | None | Security | None |
Implementation | LCAPI | Sets | Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0 |
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft