Sort list

Command group Flag affected Reversible Execute on client Platform(s)
Lists YES NO NO All

Syntax

Sort list

Deprecated Command

This command has been deprecated and is no longer visible in the Code Assistant in the Code Editor (it will not appear when you type the first few characters), although it is still present in Omnis Studio and will continue to function if used in legacy code. You can show this command by disabling the appropriate Command Filter in the Modify menu in the Code Editor.

Description

This command sorts the current list in the order specified by the current sort fields. You can use Set sort field to set the sort fields. Note that lists have to be explicitly redrawn before you can view the results of a sort.

Example

Set current list iMyList
Define list {fCustomers}
Set main file {fCustomers}
Build list from file (Use search)
Clear sort fields
Set sort field fCustomers.Surname
Set sort field fCustomers.Town
Sort list
# or do it like this
Do iMyList.$sort(fCustomers.Surname,kTrue,fCustomers.Town,kTrue)