Well, I guess you could use a query object with an item_sort column or
something if order matters.

A list retains its order, but you would need two separate lists with
matching items for the address and display, or a list within a list, but
then you would have to deal with escaping your delimiters. 

~Brad

-----Original Message-----
From: Oleg Gunkin [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 02, 2006 12:49 PM
To: CF-Talk
Subject: RE: Coldfusion hash-map

Using structs is great, except for one little glitch: item come out in
order different from the order these items were added in. Is there a way
to fix that and still use structs?

<cfset sidenav = StructNew()>
<cfset sidenav["Calendar of Events"] = "#RootDir#">             
<cfset sidenav["Yukon Council"] = "#RootDir#">                  
<cfset sidenav["Pacific Council"] = "#RootDir#">                        
<cfset sidenav["Management Community"] = "#RootDir#">

<cfoutput><img src="#RootDir#images/sidenav_logo-e.gif" width="132"
alt="YFC Logo" /></cfoutput>

<ul>
<cfoutput>
        <cfloop collection="#sidenav#" item="title">
                <li><a href="#sidenav[title]#">#title#</a></li>
        </cfloop>
</cfoutput>
</ul>


the result is :

<ul>
                <li><a href="/yfc2/">Pacific Council</a></li>
                <li><a href="/yfc2/">Yukon Council</a></li>
                <li><a href="/yfc2/">Calendar of Events</a></li>
                <li><a href="/yfc2/">Management Community</a></li>
</ul>


--
Oleg Gunkin
Email: [EMAIL PROTECTED]
Phone: (604) 666-9392
Emerging Technologies / Pacific Web Services
Information Technology Services
Public Works and Government Services Canada (Pacific)



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:231169
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