This function will save a previously created DS map to a buffer. You supply the DS map ID value (as returned by the function ds_map_create) and the buffer to write to (as returned by the function buffer_create). Note that if the DS map being saved contains an array, this will be converted into a DS list instead when saved.
NOTE This function is not supported on HTML5.
ds_map_secure_save_buffer(filename);
Argument | Type | Description |
---|---|---|
id | DS Map | The DS map ID value. |
buffer | Buffer | The buffer to save to. |
N/A
buff = buffer_create(128, buffer_grow, 4);
var _map = ds_map_create();
ds_map_add(_map, "bob", "ajob");
ds_map_add(_map, "money", 10);
ds_map_secure_save_buffer(_map, buff);
ds_map_destroy(_map);
The above code will create a buffer and a DS map, then populate the map with some values and write it to the buffer before deleting the map.