532
CFML Language Reference
</CFIF>
</CFIF>
<P>
This example uses the StructNew function to create a structure
that supplies employee information. The data structure is called
"employee" and its fields are filled with the contents of the
following form. After you have entered employee information into the
structure, the example uses the <b>StructKeyArray</b> function to copy
all of the keys from the structure into an array.
</P>
<hr size="2" color="#0000A0">
<FORM ACTION="structkeyarray.cfm" METHOD="post">
<table cellspacing="2" cellpadding="2" border="0">
<tr>
<td>First Name:</td>
<td><INPUT NAME="firstname" TYPE="text" VALUE="" hspace="30"
maxlength="30"></td>
</tr>
<tr>
<td>Last Name:</td>
<td><INPUT NAME="lastname" TYPE="text" VALUE="" hspace="30"
maxlength="30"></td>
</tr>
<tr>
<td>EMail</td>
<td><INPUT NAME="email" TYPE="text" VALUE="" hspace="30"
maxlength="30"></td>
</tr>
<tr>
<td>Phone:</td>
<td><INPUT NAME="phone" TYPE="text" VALUE="" hspace="20"
maxlength="20"></td>
</tr>
<tr>
<td>Company:</td>
<td><INPUT NAME="company" TYPE="text" VALUE="" hspace="30"
maxlength="30"></td>
</tr>
<tr>
<td><INPUT TYPE="submit" NAME="submit" VALUE="OK"></td>
<td><b>After you submit the FORM, scroll down to see the array.</b>
</td>
</tr>
</table>
</FORM>
<CFIF NOT StructISEmpty(employee)>
<hr size="2" color="#0000A0">
<CFSET keysToStruct = StructKeyArray(employee)>
<CFLOOP index="i" from="1" to="#ArrayLen(keysToStruct)#">
<P><CFOUTPUT>Key#i# is #keysToStruct[i]#</CFOUTPUT></P>
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...