sort container | ||||||||||||||||
Type | command | |||||||||||||||
Dictionary | LCS | |||||||||||||||
Library | LiveCode Script | |||||||||||||||
Syntax |
| |||||||||||||||
Summary | Sorts the lines or items of a container into a new order. | |||||||||||||||
Introduced | 1.0 | |||||||||||||||
OS | mac, windows, linux, ios, android | |||||||||||||||
Platforms | desktop, server, mobile | |||||||||||||||
Parameters |
| |||||||||||||||
Example |
| |||||||||||||||
Related | Keyword: ascending, codepoint, descending, each, text Command: convert, sort Function: offset Glossary: byte, chunk expression, item | |||||||||||||||
Description | Use the sort container command to shuffle the order of lines or items in a container. If you don't specify lines or items, the lines of the container are sorted. The each keyword, when used in the sortKey, specifies the entire line or item. You can use the each keyword in an expression, as a placeholder for the current line or item. For example, this statement sorts the lines of a variable by the third word of each line:
You can use the each keyword in any expression, not just chunk expression|chunk expressions. The sort container command is a stable sort. This means that if the sortKey for two items or lines is the same, sorting does not change their order, so you can do two successive sorts to create subcategories within the major sort categories.
| |||||||||||||||
Tags | text processing |