Sort Function

Syntax

Array Sort(Array array, Boolean inPlace, Boolean stable = False, Boolean caseSensitive = True)

Return Value

Array

Returns the sorted array. If sorting in place, returns the array you pass. Otherwise, returns a sorted copy of the array.

Purpose

This function sorts the elements of the specified array.

Parameters

array as Array

The input array to sort.

inPlace as Boolean

Pass True to directly modify the input array (in place operation). Pass False to modify only the return value without modifying the input array.

stable as Boolean

Pass True to run a stable sort, where elements with the same sort precedence are guaranteed to remain in the same order after sorting. This option can affect string values that match case insensitively in a case insensitive sort.

caseSensitive as Boolean

Pass True to use a case-sensitive sort. If True, capital letters take precedence over lowercase letters in the sort order.