With this function you can find the total number number of variables defined for an instance. You supply the instance ID to check, and the function will return an integer value for the number of variables encountered, or (if no instance of the given ID exists) -1.
variable_instance_names_count(struct_id);
| Argument | Description |
|---|---|
| instance_id | The unique ID value of the instance to check. |
Integer
var _num = variable_instance_names_count(mystruct);
show_debug_message("Instance Variables = " + string(_num));
The above code will retrieve the number of variables in the given instance and show a debug message in the console output with this value.