| CFML Reference
|
|
ColdFusion Functions
|
StructClear
Description
Removes all data from the specified structure. Always returns Yes.
Syntax
StructClear(structure)
See also
StructDelete, StructFind, StructInsert, StructIsEmpty, StructKeyArray, StructKeyExists, StructKeyList, StructCount, StructNew, StructUpdate, StructAppend, StructGet, StructSort, StructFindKey, StructClear
Parameters
| Parameter |
Description |
structure
|
Structure to clear
|
Example <!--- This example shows how to use the StructClear function. It calls
the cf_addemployee custom tag which uses the addemployee.cfm file. --->
<html>
<head>
<title>Add New Employees</title>
</head>
<body>
<h1>Add New Employees</h1>
<!--- Establish parms for first time through --->
<cfparam name = "Form.firstname" default = "">
<cfparam name = "Form.lastname" default = "">
<cfparam name = "Form.email" default = "">
<cfparam name = "Form.phone" default = "">
<cfparam name = "Form.department" default = "">
<cfif form.firstname eq "">
<p>Please fill out the form.
<cfelse>
<cfoutput>
<cfscript>
employee = StructNew();
StructInsert(employee, "firstname", Form.firstname);
StructInsert(employee, "lastname", Form.lastname);
StructInsert(employee, "email", Form.email);
StructInsert(employee, "phone", Form.phone);
StructInsert(employee, "department", Form.department);
</cfscript>
</cfoutput>
<!--- Call the custom tag that adds employees --->
<cf_addemployee empinfo = "#employee#">
<cfscript>StructClear(employee);</cfscript>
</cfif>
...
|
Copyright © 2001, Macromedia Inc. All rights reserved. |
|
|