ds_list_sort

Sorts the values in the list according to their size, either ascending or descending.

Syntax:

ds_list_sort(id, ascend);


Argument Description
id The id of the list to sort.
ascend Whether the values should be ascending (true) or descending (false) order.


Returns: N/A


Description

With this function you can sort all the values within a list, either in ascending or descending order. If the list contains strings, these will be sorted alphabetically, based on the english 26 letter alphabet.


Example:

if newgame
   {
   ds_list_sort(name_list, true);
   }

The above code will sort the list indexed in the variable "name_list" if the variable "newgame" is flagged as true.


Back: DS Lists
Next: ds_list_copy
© Copyright YoYo Games Ltd. 2018 All Rights Reserved