Could anyone translate this pseudo code to coldfusion for me please? 

Here is two implementations.  One uses a two dimension array, the other
uses a struct.  The trick with a struct is, that each key must be a
valid cold fusion variable name, so you can't really count on your data
to produce the struct names.

<!--- array --->
<cfset arr_hashmap[1][1] = "address1">
<cfset arr_hashmap[1][2] = "display2">
<cfset arr_hashmap[2][1] = "address2">
<cfset arr_hashmap[2][2] = "display2">
<cfset arr_hashmap[3][1] = "address3">
<cfset arr_hashmap[3][2] = "display3">

<!--- struct --->
<cfset struct_hashmap.linkone.address = "address1">
<cfset struct_hashmap.linkone.display = "display1">
<cfset struct_hashmap.linktwo.address = "address2">
<cfset struct_hashmap.linktwo.display = "display2">
<cfset struct_hashmap.linkthree.address = "address3">
<cfset struct_hashmap.linkthree.display = "display3">

<cfoutput>
        <!--- array --->
        <cfloop index="i" from="1" to="#arraylen(arr_hashmap)#"
step="1">
                <a
href="#arr_hashmap[i][1]#">#arr_hashmap[i][2]#</a><br>
        </cfloop> [key].address#">#struct_hashmap[key].display#</a><br>
        <br>
        <br>
        <!--- struct --->
        <cfloop list="#structKeyList(struct_hashmap)#" index="key">
                <a href="#struct_hashmap
        </cfloop>
</cfoutput>




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