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


GML Code Example

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


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.


GML Code 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

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here