BIS_fnc_sortBy
Jump to navigation
Jump to search
Description
- Description:
- Sorts an array according to given algorithm. See sort for simple sorts.
- Execution:
- call
- Groups:
- Arrays
Syntax
- Syntax:
- [array, parameters, algorithm, direction, filter] call BIS_fnc_sortBy
- Parameters:
- array: Array - any unsorted array. Can contain any types
- parameters: Array
- used in the eval algorithm
- input params are referenced in the sorting algorithm by _input0..9
- a maximum of 10 input params is supported (0-9)
- algorithm: Code - (Optional, default { _x })
- direction: String - (Optional, default "ASCEND") case-insensitive
- "ASCEND" for ascending sorting
- "DESCEND" (or anything else) for descending sorting
- filter: Code - (Optional, default { true }) code that needs to evaluate true for the array item to be sorted, otherwise item is removed
- Return Value:
- Array - sorted array
Examples
- Example 1:
- Example 2:
- Example 3:
Additional Information
- See also:
- BIS_fnc_sortAlphabetically BIS_fnc_sortNum sort
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note