ds_grid_sort

This function can be used to sort a DS grid based on the values from a given column (much as you would sort files by date, size etc... in the OS file explorer). The following image shows an example:

DS grid sort

 

Syntax:

ds_grid_sort(index, column, ascending);

ArgumentTypeDescription
indexDS GridThe index of the grid to sort.
columnRealThe column to use for sorting the rows
ascendingBooleanWhether to sort lowest to highest (true), or highest to lowest (false).

 

Returns:

N/A

 

Example:

ds_grid_sort(grid, 3, false)

This would take all the values in the DS grid indexed in the variable "grid" and sort them according to the values found in the 3rd column of the grid (as shown in the above image).