Of course, the both of you are correct. Oddly, the fact that CF5 sorted
Structs to begin with is my achielles (sp) heel... I'll now have to rewrite
many parts of my app to make things work.

Thanks, Che

-----Original Message-----
From: Ken Ferguson [mailto:[EMAIL PROTECTED]
Sent: Monday, June 20, 2005 2:42 PM
To: CF-Talk
Subject: Re: StructSort Question... I am stumped.

I agree with Raymond of course, but look, if you want to do inserts in a
specific order, you can do that just as easily as you can present your
data in a specific order. If you were going to order your data for
presentation, you'd do something like this:

<cfset sorted = listSort(structKeyList(thedata), "numeric")>
<cfloop list="#sorted#" index="i">
  #i# :  #structFind(theData, i)#
</cfloop>

That would present the data in the desired order.
So just use the same convention in creating your inserts when you do the
processing and you'll get the results you're seeking.

<cfset sorted = listSort(structKeyList(thedata), "numeric")>
<cfloop list="#sorted#" index="i">
insert into table(field) values(#structFind(theData, i)#
</cfloop>

Of course, each of your keys contains an array, so there's more work to
be done in reality, but just because the data isn't sorted for you and
just because it's silly to do it, doesn't mean you can't get it done..


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:210014
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to