ds_map_write

This function writes the data from a ds_map as a string.

Syntax:

GML Code Example

ds_map_write(id);


Argument Description
id The id of the data structure to use


Returns: String


Description

This function will turn the ds_map data of the specified map into string format which can then be written to an *.ini or a *.txt file for easy storage. This string can then be later read back into a new ds_map using ds_map_read().

NOTE: The returned string is not a human readable string, but rather a dump of the contents of the data-structure


Example:

GML Code Example

ini_open("map.ini");
 var t_string;
 t_string = ds_map_write(inventory);
 ini_write_string("Saved", "0", t_string);
 ini_close();
 

The above code opens an ini file ready to be written to. It then uses ds_map_write() to generate a string which is stored in the temporary variable "t_string". Finally, it writes that string to the ini file before closing it.


Back: DS Maps



No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here