Skip to content

Sorting

Functions that sort, such as sort() and setunion(), take one of these sort types.

TypeSorts
atext, case-sensitive: capitals come before lower case
itext, ignoring case
ddbrefs, by number
nwhole numbers
fdecimal numbers
mtext with numbers and dbrefs in it, numbers in number order
namedbrefs by their names, case-sensitive
nameidbrefs by their names, ignoring case
conndbrefs by their connection time
idledbrefs by their idle time
ownerdbrefs by their owners’ dbrefs
locdbrefs by their locations’ dbrefs
ctimedbrefs by their creation time
mtimedbrefs by their modification time
lattrattribute names

A minus sign before the type, such as -a, reverses the order.

> think sort(b A a B c C,a)
A B C a b c
> think sort(b A a B,-a)
b a B A

attr:<attribute> sorts dbrefs by the value of that attribute on each, case-sensitive; attri:<attribute> does the same, ignoring case. For instance, attri:SPECIES groups characters by their SPECIES attribute.

::: seealso