struct_names_count

This function gets the total number number of variables defined in a struct.

You supply the struct ID to check, and the function will return an integer value for the number of variables encountered, or (if no struct of the given ID exists) -1.

 

Syntax:

struct_names_count(struct_id);

Argument Type Description
struct_id Struct The unique ID value of the struct to check.

 

Returns:

Real

 

Example:

var _num = struct_names_count(mystruct);
show_debug_message("Struct Variables = " + string(_num));

The above code will retrieve the number of variables in the given struct and show a debug message in the console output with this value.