ds_map_copy

You can use this function to copy the contents of one map into another one that you have previously created using ds_map_create(). If the DS map that is being copied to is not empty, then this function will clear it first before copying. The original DS map remains unchanged by this process.

 

Syntax:

ds_map_copy(id, source);

ArgumentTypeDescription
idDS MapThe id of the map you are copying to
sourceDS MapThe id of the map you are copying from

 

Returns:

N/A

 

Example:

inventory_2 = ds_map_create();
ds_map_copy(inventory_2, inventory_1);

The above code will create a new map and assign it to the variable "inventory_2". It will then copy the contents of the DS map indexed in the variable "inventory_1" to this new map.