Ar SortAlpha

< [[::Category:Functions|Category:Functions]]

A function added by the New Vegas Script Extender.

Description

Sorts the elements of an array alphabetically in ascending or descending order and returns a new Array containing the elements in sorted order. Ordering is case-insensitive. Unlike Ar_Sort, does not require elements to be of the same type - numeric elements are converted to a string representation, and forms are sorted by their names (if named) or the string representation of their formIDs. Omitting the optional parameter causes elements to be sorted in ascending order.

Syntax

(array) Ar_SortAlpha Source:anyarray SortDescending:bool

Example

array_var aOriginal
array_var aSorted

let aOriginal := Ar_List 5, 1, Jet, "xylophone", SunnyREF

let aSorted := Ar_SortAlpha aOriginal

; aSorted contains: 1, 5, Jet, SunnyREF, "xylophone"

See Also