listToSortedArray

Creates an alphabetically sorted array of items from a delimited string.

Syntax

listToSortedArray(textList, delimeters, arrayName, ascend)

Parameters

textList

Specifies a string containing items separated by any of the delimeters specified in the delimeters parameter.

delimeters

Specifies a string in which each character is a delimeter that can serve to separate the elements specified in the textList parameter.

arrayName

Specifies the name of the array that will be created.

ascend

Specifies whether to sort the returned array in ascending or descending order.

  • 1: Sort the array in ascending order.
  • 2: Sort the array in descending order.

Returns

Returns an empty string.

Remarks

The listToSortedArray function works the same way as the listToArray function, except that the items in the array are sorted alphabetically. For example,

{VAR listToSortedArray("one, two three;four,;seven", ", " "Numbers", 1}

will generate an array called Number that has the following values:

Numbers[1]=four
Numbers[2]=one
Numbers[3]=seven
Numbers[4]=three
Numbers[5]=two
Numbers.count=5

For more information about using arrays, see Section 2.7, Arrays.