Sorts a one dimensional dynamic array.

Syntax

NewArray = SRP_Array("SortSimpleList", Array, Option, Delim)

Returns

The sorted array.

Parameters

ParameterDescription
ArrayThe one dimensional dynamic array to be sorted. (REQUIRED)
OptionA keyword indiciating how the array is to be sorted. (OPTIONAL)
DelimThe delimiter that separates elements of the Array. (OPTIONAL)

Remarks

While the SortRows provides everything needed to sort both one and two dimensional arrays, this service simplifies the process greatly of sorting single dimensional arrays. Have a small simple list to sort? This is the service for you. Simple pass in the array and choose one of four sorting options: "AscendingText", "DescendingText", "AscendingNumbers", or "DescendingNumbers".

The Delim parameter tells the service what delimiter is used to delimit elements in the given array. When omitted, @FM is assumed.

Examples

// Sort a simple list using custom delimiters
List = "Don":@FM:"Paul":@FM:"Frank":@FM:"Bob":@FM:"Kevin"
List = SRP_Array("SortSimpleList", List)
// List will be: "Bob":@FM:"Don":@FM:"Frank":@FM:"Kevin":@FM:"Paul"
 
// Sort a simple list in reverse order
List = "Don":@FM:"Paul":@FM:"Frank":@FM:"Bob":@FM:"Kevin"
List = SRP_Array("SortSimpleList", List, "DescendingText")
// List will be: "Paul":@FM:"Kevin":@FM:"Frank":@FM:"Don":@FM:"Bob"
 
// Sort a simple list using custom delimiters
List = "81,90,44,66,52"
List = SRP_Array("SortSimpleList", List, "AscendingNumbers", ",")
// List will be: "44,52,66,81,90"