You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

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. Simply pass in the array and choose one of four sorting options: "AscendingText", "DescendingText", "AscendingNumbers", or "DescendingNumbers".

  • "AscendingText" performs a left sort in alphabetical order.
  • "DescendingText" performs a left sort in reverse alphabetical order.
  • "AscendingNumbers" performs a sort in numerical order.
  • "DescendingNumbers" performs a sort in reverse numerical order.

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"
  • No labels