ds_map_replace


Description

With this function you can change the value for the given key within the (previously created) ds_map. Please note that if the key to be replaced does not exists, it is created and the given value assigned to it.


Syntax:

ds_map_replace( id, key, val );

Argument Description
id The id of the map to change.
key The key with the value that should be replaced by the new one
val The new value to replace the given value with


Returns:

N/A


Example:

ds_map_replace(inventory, "torso", 55);

The above code looks up the ds_map for the key "torso" and when it finds it (or it is created if it doesn't exist) the current value is replaced with the one specified.