// ds_map_repr(id, multiline)
// Returns a string representation of the given map
var map, s, del, key, pair;
map = argument0;
s = '';
if (argument1)
del = '#';
else
del = ', ';
for (key = ds_map_find_first(map);
ds_map_exists(map, key);
key = ds_map_find_next(map, key)) {
if (s != '')
s += del;
pair = string(key) + ': ' + string(ds_map_find_value(map, key));
if (!argument1)
pair = '(' + pair + ')';
s += pair;
}
if (!argument1)
s = '[' + s + ']';
return s;
Categories: Data processing, String handling
There are no comments to display.
You must be signed in to post comments.