In CF5 it always held them in alphabetical order, but in CFMX, it stores
the as they are created (or how is see's them as being created)
Why not re-write it to create the available letters, then loop from A-Z
and check if they're in the list?
-----Original Message-----
From: Shawn McKee [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 25, 2003 4:59 PM
To: CF-Talk
Subject: CFMX and a collection loop problem
We store language translations for our site in an XML file that we load
into an application variable like this.
<cffile action="" file="#attributes.xmlfile#" variable="wddxpacket">
<cfwddx action="" input="#wddxpacket#"
output="application.translate">
In CF5.x we access via a loop to make an editing interface.
<cfset lastletter = '@'>
<cfloop collection="#application.translate#" item="field">
<cfif mid(field,1,1) NEQ lastletter AND mid(field,1,1) NEQ '1'>
<cfset lastletter = mid(field,1,1)>
<cfset anchorhref = '##'&lastletter>
<cfoutput>
<input type="Radio" name="letter" value="#lastletter#"
size="+1"
color="##000080">#lastletter#</font>
</cfoutput>
</cfif>
</cfloop>
This then prints out a nice list of the letters of the alphabet that
have content. All works great in CF5 but under MX the fields are
brought back in a pseudo random order. If I do a <cfdump> of the
application variable it is just fine it is only inside the loop that I
have problems.
Shawn
www.newsstand.com
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

