August 2003
Intermediate to advanced
1140 pages
68h 45m
English
StructIsEmpty
StructIsEmpty(structure)Returns true if the specified structure contains
no data or false if it contains data.
StructIsEmpty( ) throws an error if the specified
structure does not exist, so it’s generally a good
idea to test for the existence of the structure first using
IsDefined( ), before checking whether it is empty.
The following example checks to see if the structure
Employee is empty:
<cfset Employee=StructNew( )>
<cfset Employee.Name="Pere Money">
<cfset Employee.Title="President">
<cfset Employee.Department="Executive Management">
<cfset Employee.Email="pmoney@example.com">
<cfset Employee.PhoneExt="1234">
<cfif IsDefined('Employee')>
<cfif StructIsEmpty(Employee)>
The structure <b>Employee</b> is empty!
<cfelse>
The structure <b>Employee</b> is not empty.
</cfif>
</cfif>