ds_list_clear

Clears all of the data from a given list.

Syntax:

GML Code Example

ds_list_clear(id);


Argument Description
id The id of the data structure to clear.


Returns: N/A


Description

With this function you can clear all data from the given list data-structure. This does NOT destroy the data-structure (for that you should use ds_list_destroy) it only wipes all data from it and returns an empty list.


Example:

GML Code Example

if count = 15 && !ds_list_empty(command_list)
    {
    ds_list_clear(command_list);
    alarm[0] = room_speed;
    ai_count = 0;
    }
 

The above code checks a variable to see if it has reached a specific value and if it has it clears the ds_list indexed in the variable "command_list", sets an alarm, and resets the variable to 0.


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