The "ds_struct_write" Function
Syntax#
| Argument | Type | Description |
|---|---|---|
id | struct | The struct to encode as a string |
[pretty] | boolean | Optional: Enables or disables formatting the string with linebreaks and indentation |
Description#
Converts a struct and its contents to a string, optionally with "pretty-print" to separate values by line with proper indenting.
caution
Note that only single values, arrays, strings, and sub-structs are interpreted by this function. Other data structures, like ds_map or ds_grid, are stored by reference only and will be written as a numerical index rather than their actual contents. To avoid this behavior, first use the respective ds_*_write function on these data structures so they will be included as strings which can be decoded later with ds_*_read.

X1