Chapter 2: ColdFusion Functions
525
StructDelete
Removes the specified item from the specified structure.
See also
StructClear
,
StructFind
,
StructInsert
,
StructIsEmpty
,
StructKeyArray
,
StructCount
,
StructKeyArray
, and
StructUpdate
.
Syntax
StructDelete
(
structure, key [, indicatenotexisting ])
structure
Structure containing the item to be removed.
key
Item to be removed.
indicatenotexisting
Indicates whether the function returns FALSE if key does not exist. The default is
FALSE, which means that the function returns Yes regardless of whether key exists.
If you specify TRUE for this parameter, the function returns Yes if key exists and No
if it does not.
Example
<!--- This example shows how to use the StructDelete function. --->
<HTML>
<HEAD>
<TITLE>StructDelete Function</TITLE>
</HEAD>
<basefont face="Arial, Helvetica" size=2>
<body bgcolor="#FFFFD5">
<H3>StructDelete Function</H3>
<P>
This example uses the StructInsert and StructDelete functions.
<!--- Establish parms for first time through --->
<CFPARAM NAME="firstname" DEFAULT="Mary">
<CFPARAM NAME="lastname" DEFAULT="Torvath">
<CFPARAM NAME="email" DEFAULT="[email protected]">
<CFPARAM NAME="phone" DEFAULT="777-777-7777">
<CFPARAM NAME="department" DEFAULT="Documentation">
<CFIF IsDefined("FORM.Delete")>
<CFOUTPUT>
Field to be deleted: #form.field#
</CFOUTPUT>
<P>
<CFScript>
employee=StructNew();
StructInsert(employee, "firstname", firstname);
StructInsert(employee, "lastname", lastname);
StructInsert(employee, "email", email);
StructInsert(employee, "phone", phone);
StructInsert(employee, "department", department);
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...