Whatever message this page gives is out now! Go check it out!

StructKeyList

Last update:
May 18, 2026

Description

Extracts keys from a ColdFusion structure.

Returns

A list of keys; if structure does not exist, ColdFusion throws an exception.

Category

Syntax

StructKeyList(structure [, delimiter])

See also

Structure functionsModifying a ColdFusion XML object in the Developing ColdFusion Applications

Parameters

Parameter
Description
structure
Structure from which to extract a list of keys.
delimiter
Optional.  Character  that separates keys in  list . The default value is  comma .

Example

<cfscript>
       myStruct=StructNew();
       myStruct = {a:1,b=2,c=3,d=4,e=5};
       myKeyList=StructKeyList(myStruct);
       WriteOutput(myKeyList & " | ");
       try{
             StructKeyList(someStruct);
       }
       catch (any s){
             WriteOutput(s.message);
       }
</cfscript>

Output

a,b,c,d,e | Variable SOMESTRUCT is undefined.

Using member function

<cfscript>
       myStruct = {a:1,b=2,c=3,d=4,e=5};
       myKeyList=myStruct.keyList(";");
       WriteOutput(myKeyList);
</cfscript>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page