DSort function

Sort lists and tables


Description

The DSort function sorts the elements of a list or table according to their values ​​in descending order.


Tables

In the case of a table, the number of a column can be optionally specified according to which the rows are sorted. If no column is specified, the values ​​are sorted line by line.


Syntax

DSort (list)

DSort (table, column)

Example with list

a=Rnd(New(12, 20))

a= 4 0 18 8 10 6 8 3 7 15 12 12

DSort(a)=18 15 12 12 10 8 8 7 6 4 3 0


Example with invalid value

Ungültige Werte, z.B. Unendlich oder Texte werden unsortiert an das Ende der Liste gesetzt.

b = [1,3,6,-1,(1/0),8,2]

b=1 3 6 -1 ∞ 8 2

DSort(b)=8 6 3 2 1 -1 ∞


Example without column number

In Tabellen wird Zeilenweise von links nach rechts absteigend sortiert, wenn keine Spalte angegeben wird


Example with column number

If a column number is specified, the rows are sorted by the values ​​in the specified column. The order in the individual lines is not changed.