• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Name

StructIsEmpty

Synopsis

                   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>

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint