MACROMEDIA COLFUSION MX 7-CFML Reference page 875

Cfml reference
Hide thumbs Also See for COLFUSION MX 7-CFML:
Table of Contents

Advertisement

StructNew
Description
Creates a structure.
Returns
A structure.
Category
Structure functions
Function syntax
StructNew()
See also
Structure
functions; "Structure functions" in Chapter 5, "Using Arrays and Structures," in
ColdFusion MX Developer's Guide
Parameters
None
Example
<!--- Shows StructNew. Calls CF_ADDEMPLOYEE, which uses the |
addemployee.cfm file to add employee record to database. --->
<h1>Add New Employees</h1>
<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>
<p>First name is #StructFind(employee, "firstname")#
<p>Last name is #StructFind(employee, "lastname")#
<p>EMail is #StructFind(employee, "email")#
<p>Phone is #StructFind(employee, "phone")#
<p>Department is #StructFind(employee, "department")#
</cfoutput>
<!--- Call the custom tag that adds employees --->
<CF_ADDEMPLOYEE EMPINFO = "#employee#">
</cfif>
StructNew
875

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents