Sort 1D Array
- Updated2025-07-30
- 3 minute(s) read
Returns a sorted version of unsorted array with the elements arranged in ascending order. If unsorted array is an array of clusters, the function sorts the elements by comparing the first elements. If the first elements match, the function compares the second and subsequent elements. The connector pane displays the default data types for this polymorphic function.

Inputs/Outputs
unsorted array
—
unsorted array can be a 1D array of any type.
less function (built-in <)
—
less function is the comparison used to search the array. By default, this is the same comparison the standard Less? function uses. If the array element is a class with a Less Than method that includes two inputs of the same type and a boolean output in the connector pane To specify a different sort order, wire this terminal to one of the following objects:
The comparison function must be symmetric. If a<b is true, b<a is false. If a and b are the same value, both a<b and b<a are false. If the function is not symmetric, the search results will be unpredictable.
sorted array
—
sorted array is the output array. |
Examples
Refer to the following example files included with LabVIEW.
- labview\examples\Malleable VIs\Nested Malleable VIs\Malleable VIs - Nested Malleable VIs.lvproj
unsorted array
—
less function (built-in <)
—
, the default changes to use that comparison.
:
:
sorted array
—