Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Sorts a list with using an expression to evaluate.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
List | 10.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
List | The list to sort. | "Hello" ¶ "World" | |
Expression | The expression to evaluate. Can include "leftValue" and "rightValue" as variables. |
"leftValue > rightValue" | |
NoReturnEnding | 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 | Optional |
Returns OK or error.
Sort numbers numeric with GetAsNumber() function:
MBS("List.SortWithEvaluate"; "1¶22¶3"; "GetAsNumber(leftValue) < GetAsNumber(rightValue)")
Example result:
1
3
22
Sort dates with using GetAsDate:
MBS("List.SortWithEvaluate"; "1/1/2000¶2/22/2020¶3/4/1998"; "GetAsDate(leftValue) < GetAsDate(rightValue)")
This function checks for a license.
Created 9th April 2020, last changed 13th May 2020