StructIsEmpty

Indicates whether the specified structure contains data. Returns TRUE if structure is empty and FALSE if it contains data.

See also StructClear, StructDelete, StructFind, StructInsert, StructKeyArray, StructCount, StructKeyExists, and StructUpdate.

Syntax

StructIsEmpty(structure)
structure

Structure to be tested.

Usage

This function throws an exception if structure does not exist.

Example

<!--- This example illustrates usage of StructIsEmpty. --->
<!---------------------------------------------------------------
This example assumes that you have created and assigned values
to the fields of a structure named EMPINFO.
----------------------------------------------------------------->
<CFIF StructIsEmpty(EMPINFO)>
        <CFOUTPUT>Error. EMPINFO is empty.</CFOUTPUT>
<CFELSE>
        tempStruct=StructCopy(EMPINFO)
        <CFQUERY NAME="AddEmployee" DATASOURCE="HRApp">
          INSERT INTO Employees
              (FirstName, LastName, StartDate, Salary, Contract,
                Department_ID)
            VALUES 
              <CFOUTPUT>
                (
                  `#StructFind(tempStruct, "FirstName")#' ,
                  `#StructFind(tempStruct, "LastName")#' ,
                  `#StructFind(tempStruct, "StartDate")#' ,
                  `#StructFind(tempStruct, "Salary")#' , (
                  `#StructFind(tempStruct, "Contract")#' ,
                  `#StructFind(tempStruct, "Department_ID")#' 
                )
            </CFOUTPUT>
        </CFQUERY>
</CFIF>
<HR>Employee Add Complete
<CFOUTPUT>
         <P>#StructCount(tempStruct)# columns added.
</CFOUTPUT>
...