Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 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.
  • "AscendingRight" performs a right-aligned sort in alphabetical order.
  • "DescendingRight" performs a right-aligned sort in reverse alphabetical order.

Note: You can append a "C" to the end of the above options to make them case insensitive.

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

...

Code Block
// Sort a simple list using customthe default delimitersdelimiter
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 a custom delimitersdelimiter
List = "81,90,44,66,52"
List = SRP_Array("SortSimpleList", List, "AscendingNumbers", ",")
// List will be: "44,52,66,81,90"

...