Skip to main content

The "ds_list_add_map" Function

Syntax#

ds_list_add_map(id, source);
ArgumentTypeDescription
idds_listThe data structure to add new data to
sourceds_mapThe data structure to be added

Description#

Adds the contents of a previously-created ds_map to the specified ds_list.

Intended only for use with JSON functions. Normally, adding one data structure to another simply stores a reference to the data structure, therefore this function is necessary to flag the map value as a data structure itself so its contents are written to the JSON file.

As JSON data is unordered by nature, there is no need to input an index at which to insert the new map.

Example#

my_list = ds_list_create();
my_map = ds_map_create();
ds_list_add_map(my_list, my_map);