output an array

Hi,

I need to loop and output my array.


<cfset i="1" />
<cfset ListSubMenuArray = arraynew(2)> 
<cfloop query="DispSubMenu">
<cfset ListSubMenuArray [i][1]="#SubMenuName#" />
<cfset ListSubMenuArray [i][2]="#SubMenuURL#" />
<cfset i= i+1>
</cfloop> 
<cfloop index="i" from="1" to="#arrayLen(ListSubMenuArray )#">
 //here I need to output my array 


                             <td style="border-right: 1px solid #adc0d1;border-top: 1px solid #adc0d1;border-left: 
						1px solid #adc0d1;border-bottom: 1px solid #adc0d1;width:150px;height:30px;" background="images/bg.gif"><a href="Array URL Should be here" style="color: #000000" onMouseOver="this.style.color='#93b38e'" onMouseOut="this.style.color='#000000'"><cfoutput>#Array Name should be here#</cfoutput></a>
</td><



 </cfloop>

Open in new window

lulu50Asked:
Who is Participating?
 
_agx_Connect With a Mentor Commented:
<cfoutput>#Array Name should be here#</cfoutput>

You can't cfoutput a complex object. You have to output the elements separately

ie
...
<cfoutput>
#ListSubMenuArray[i][1]#
#ListSubMenuArray[i][2]#
</cfoutput>

Open in new window


But why do you even need an array? It's much simpler to output your original query.
0
 
lulu50Author Commented:
Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.