With this function you can retrieve an array populated with the variable names from a struct. You pass in the struct reference to check, and each entry in the array will be a string of the variable names that the struct contains.
variable_struct_get_names(struct);
| Argument | Description |
|---|---|
| struct | The struct reference to check. |
Array (each entry is a string)
var str = "";
var array = variable_struct_get_names(mystruct);
show_debug_message("Variables for struct: " + string(array));
for (var i = 0; i < array_length(array); i++;)
{
str = array[i] + ":" + string(variable_struct_get(mystruct, array[i]));
show_debug_message(str);
}
The above code will retrieve an array of the variable names for the given struct and then display these along with their values in the debug output.