var keys = variable_struct_get_names(strc);
for (var i = array_length(keys)-1; i >= 0; --i) {
var k = keys[i];
var v = strc[$ k];
/* Use k and v here */
}
strc[$ k]
with variable_struct_get(strc, k)
.General merging, deep cloning/copying, and nested value-wise equivalence all rely on the struct iteration book line I described.I suppose it works as an academic exercise, but I can't imagine what practical purpose there would be to this.
var some_struct = { lorem: 123, ipsum: 456, dolor: 789, sit: 1011, amet: 1213 };
var keys = variable_struct_get_names(some_struct);
show_debug_message(keys); // will show the messy unordered keys
array_sort(keys, true /* ascending order */);
show_debug_message(keys); // now the keys are neatly ordered!