Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

QuickList.Sort

Sorts the list.

Component Version macOS Windows Linux Server iOS SDK
List 4.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "QuickList.Sort"; ListRef { ; Flags } )   More

Parameters

Parameter Description Example Flags
ListRef The reference to the list returned from QuickList.New function. $List
Flags 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 Optional

Result

Returns OK or error.

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.

Add mode 16 for flags to sort by numbers for version 11.0.

Examples

Sort a list:

Let
([
l = MBS("QuickList.New"; "a¶e¶ä¶f¶1");
r = MBS("QuickList.Sort"; l);
list = MBS("QuickList.GetList"; l);
r = MBS("QuickList.Release"; l)
]; list )

Sort a list ascending case sensitive:

Let
([
l = MBS("QuickList.New"; "A¶e¶ä¶Ä¶9¶1");
r = MBS("QuickList.Sort"; l);
list = MBS("QuickList.GetList"; l);
r = MBS("QuickList.Release"; l)
]; list )

Sort a list descending case insensitive:

Let
([
l = MBS("QuickList.New"; "A¶e¶ä¶Ä¶9¶1");
r = MBS("QuickList.Sort"; l; 3);
list = MBS("QuickList.GetList"; l);
r = MBS("QuickList.Release"; l)
]; list )

See also

Release notes

Blog Entries

This function checks for a license.

Created 21st September 2014, last changed 14th December 2023


QuickList.Shuffle - QuickList.SortWith