-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Scott,
There is a section in the documentation from the SP2 release of CF
4.5.1 regarding this function. I've pasted the function's syntax
below along with an example of how you might use it to sort a
structure returned from a Spectra CODB get.
Syntax StructSort(Base [, SortType, SortOrder, PathToSubElement])
Base
A ColdFusion struct with one field (an associative array).
PathToSubElement
Specifies the path to apply to each of the top-level keys in order to
reach the
element whose value you wish to sort by. If unspecified,
PathToSubElement,
defaults to nothing: meaning that the top-level entries will be
sorted based on
their own values.
SortOrder
SortOrder may be "ASC" (ascending) or "DESC" (descending). The
default is
"ASC."
SortType
SortType may be "NUMERIC", "TEXT", or "TEXTNOCASE". The default is
"TEXT."
so, for example:
<!--- get all conditions --->
<cfa_contentObjectGetMultiple
datasource = "#request.cfa.objectstore.dsn#"
typeID = "16BC70D0-CF57-11D3-940600500474A309"
bActiveOnly = "FALSE"
bNonArchivedOnly = "FALSE"
r_stObjects = "stConditionObjects">
<!--- sort conditions by label --->
<cfset aConditionKeys = StructSort(stConditionObjects,
"TEXTNOCASE", "ASC", "LABEL")>
<!--- loop through --->
<cfloop from="1" to="#ArrayLen(aConditionKeys)#" index="i">
<cfoutput>#stConditionObjects[aConditionKeys[i]].label#<br></cfoutput>
</cfloop>
HTH
Aaron Johnson, MCSE, MCP+I
Allaire Certified ColdFusion Developer
MINDSEYE, Inc.
<phn>617.350.0339
<fax>617.350.8884
<icq>66172567
[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists