On Wednesday, September 18, 2002, at 03:31  PM, Sean Daniels wrote:

> OK, so I've read the livedocs explaining the changes to the way
> structures behave in MX, but I'm not finding it to be the case...
> here's what the docs say:
>
> "ColdFusion MX returns struct keys in the order that you create them.
> ColdFusion�5 returns struct keys in alphabetical order. If you need
> sorted struct values or keys, use the StructSort() and StructKeySort()
> functions."
>
> I have the following code to create a structure for navigation:
>
> <cfscript>
>       opts = structnew();
>       opts[0]=structnew();
>       opts[0]["fa"]="foo";
>       opts[0]["lab"]="Option A";
>       opts[0]["dsc"]="My Description.";
>       opts[1]=structnew();
>       opts[1]["fa"]="foo";
>       opts[1]["lab"]="Editor";
>       opts[1]["dsc"]="Add, edit, and delete.";
>       opts[2]=structnew();
>       opts[2]["fa"]="enewsmailings.main";
>       opts[2]["lab"]="Creator";
>       opts[2]["dsc"]="Tools for creating things.";
> </cfscript>

The list hacked my message apart. Here's the rest:

When I loop over this top level struct, I would expect my results to 
come out the order they were created, but instead they are seemingly 
sorted alphabetically by the "dsc" key:

<cfloop collection="#opts#" item="ii">
<b>#opts[ii]['lab']#</b></a><br />#opts[ii]['dsc']#<br /><br />
</cfloop>
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to