Counts the keys in a structure.
structCount(structure)
returns numeric
Name | Type | Required | Default | Description |
---|---|---|---|---|
structure | struct | Yes | Structure to access |
Pass a structure as an argument to the function.
user = {
id = 1,
firstname = "Han",
lastname = "Solo",
movie = "Star Wars"
};
writeDump( structCount( user ) );
CF11+ Lucee4.5+ Having a reference of a structure as a variable, use the dot notation to get a key count on it using a member function.
user = {
id = 1,
firstname = "Han",
lastname = "Solo",
movie = "Star Wars"
};
writeDump( user.count() );