ds_map_clear

Clears all of the data from a given map.

Syntax:

GML Code Example

ds_map_clear(id);


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


Returns: N/A.


Description

This function will clear the (previously created) ds_map of all key/value pairs, but it will not delete the ds_map itself from memory. For that you should use the function ds_map_destroy.



Example:

GML Code Example

if global.new_game
    {
    ds_map_clear(inventory);
    }
 

The above function will check a global variable to see if it is true and, if it is, then the ds_map indexed in the instance variable "inventory" will be cleared of all key/value pairs (but it is not destroyed).


Back: DS Maps



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