Structkeylist - MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference

Cfml language reference
Table of Contents

Advertisement

Chapter 2: ColdFusion Functions

StructKeyList

Returns the list of keys that are in the specified ColdFusion structure.
See also StructKeyArray, StructClear, StructDelete, StructFind, StructInsert,
StructIsEmpty, StructCount, and StructUpdate.
Syntax
StructKeyList( structure , [ delimiter ])
structure
Structure from which the list of keys are to be extracted.
delimiter
Optional. The value of this parameter indicates the character that will separate the
keys in the list. By default, a comma (,) is used.
Usage
The list of keys returned by StructKeyList is not in any particular order. In order to sort
keys alphabetically or numerically, use ListSort.
Note that this function throws an exception if structure does not exist.
Example
<!--- This example shows how to use the StructKeyList
function to list the keys within a specified structure.
It also uses the StructNew function to create the structure
and fills its fields with the information the user types
into the corresponding form fields. --->
<!--- This section of code creates the new structure and checks to
see if the submit button has been pressed.
pressed, the code defines fields in the employee structure
with what the user has entered from the form. --->
<CFSET employee=StructNew()>
<CFIF Isdefined("Form.Submit")>
<CFIF Form.Submit is "OK">
<CFELSEIf Form.Submit is "Clear">
</CFIF>
</CFIF>
<HTML>
<HEAD>
<TITLE>StructKeyList Function</TITLE>
</HEAD>
<basefont face="Arial, Helvetica" size=2>
<CFSET employee.firstname = FORM.firstname>
<CFSET employee.lastname = FORM.lastname>
<CFSET employee.email = FORM.email>
<CFSET employee.phone = FORM.phone>
<CFSET employee.company = FORM.company>
<CFSET rc=StructClear(employee)>
535
If it has been

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion 4.5

Table of Contents