ds_map_exists


描述

This function will return true if the specified key exists in the (previously created) ds_map, and false if it does not.


语法:

ds_map_exists(id, key);

参数 描述
id the id of the data structure to check
key the key to check for


Returns:

Boolean


例如:

if !ds_map_exists(inventory, "potions")
   {
   ds_map_add(inventory, "potions", 1);
   }

The above code will check the ds_map indexed in the variable "inventory" for the key "potions" and if it doesn't exist it will add it to the map.