Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

List.Sort

Sorts the list.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
List 4.2 Yes Yes Yes Yes Yes

MBS( "List.Sort"; List { ; Flags; NoReturnEnding } )

Parameters

Parameter Description Example value
List The list to sort. "Hello" ¶ "World"
Flags Optional
Optional, whether to sort case insensitive or descending.
Pass 1 to sort case insensitive or 0 to sort case sensitive.
Add 2 to sort descending.
Add 4 for sorting dates in DD.MM.YYYY style and 8 for sorting dates in MM.DD.YYYY style.
1
NoReturnEnding Optional
Pass 1 to have no extra newline character on the end of the returned list. Default is 0 to include one to easily concat lists.
1

Result

Returns new list.

Description

Sorts the list.
Version 6.2 adds new modes for date sorting. Mode 4 for DD.MM.YYYY style and mode 8 for MM.DD.YYYY style.

Examples

Sort case sensitive:

MBS( "List.Sort"; "Hello¶World¶Test" )

Sort case insensitive:

MBS( "List.Sort"; "Hello¶World¶test"; 1 )

Sort case sensitive and descending:

MBS( "List.Sort"; "Hello¶World¶Test"; 2 )

Sort case insensitive and descending:

MBS( "List.Sort"; "Hello¶World¶test"; 3 )

Sort German dates:

Show Custom Dialog [MBS("List.Sort"; "01.01.2001¶12.04.1981¶01.04.1981¶12.07.1981¶12.01.1981¶23.11.2014"; 4; 0)]

Sort US dates:

Show Custom Dialog [MBS("List.Sort"; "01/01/2001¶04/12/1981¶04/01/1981¶07/12/1981¶01/12/1981¶11/23/2014"; 8; 0)]

See also

Example Databases


List.SetValue   -   List.SubList

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins