>The reason there is no rhyme or reason is because structs are implemented >as >HashMaps in CFMX, which by definition don't have an order to the values. I >would imagine that you'll get them back in hashCode() order, but that's not >guarenteed consistent because of collision resolution.
According to the CFMX docs, the key are ordered according to the date/time that the key was inserted into the structure. I should note that if you use <cfdump> and see that the keys are alphabetized in MX, it's becaue the <cfdump> tag re-orders the keys alphabetically before outputting to the user. Internally though, it's still by date/time. >I'm not sure how they were implemented in CF5 and below, but it wasn't a >Java HashMap. Probably was still a HashMap, but with a different >implementation of the getKeyList() method that sorted the key list first. As Ray pointed out, structures were ordered alphabetically in CF versions previous to MX, but that behavior was not promised to remain the same in future versions -- it was more of a convenience. Regards, Dave. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq 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 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4