From RPTools Wiki
Revision as of 19:58, 11 December 2019 by Aliasmask (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.

listSort() Function

Returns a sorted list.


[listSort(list, sortType)]
[listSort(list, sortType, delim)]


  • list - The list that is sorted.
  • sortType - The direction that this list is sorted. "A+" - alpha ascending, "A-" - alpha descending, "N-" - padded ending numbers descending alpha
  • delim - The delimiter used in the separate the list, defaults to ",".

The sortType determines the type of sort to use. If sortType is "A", normal alphabetic sorting is used, and "Monster11" comes before "Monster3". (Default behavior) If sortType is "N", the first number in each entry is effectively padded to 4 digits, so that "Monster3" comes before "Monster11". The sortType can have a second character of "+" or "-" to specify an ascending or descending sort.


[h: UnsortedList = "Monster11,Monster3,Monster12,Monster66,Monster87,Monster71"]
[h: SortedList = listSort(UnsortedList,'N')]

Unsorted list: [r: UnsortedList]<br>
Sorted list: [r: SortedList]


 Unsorted list: Monster11,Monster3,Monster12,Monster66,Monster87,Monster71
Sorted list: Monster3, Monster11, Monster12, Monster66, Monster71, Monster87