Hi

I'm looping over a list e.g. ("D, C, B, A") and inserting into a structure
as follows:

<cfset list="D,B,C,A">
<cfset struct= structnew()>
<cfloop index="i" list="#list#" delimiters=",">
<cfscript>
StructInsert(struct, i,"");
</cfscript>
</cfloop>

but when I ouput the structure, it is sorted alphabetically by key.  

<cfloop collection="#struct#" item="i">
<cfoutput>#i# #struct[i]#<br></cfoutput>
</cfloop>

So the above code would output:
A
B
C
D

Instead of what i want which is (The same order the elements were in the
original list)
D
B
C
A

Anyone know any way to keep the output order the same as the input order or
are they always automatically sorted?
Thanks
Mark
Mark Smyth 
Developer 
SystemsUnion.Net
00 44 1865 880800 
[EMAIL PROTECTED] 
www.systemsunion.net

______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.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