?
Solved

output an array

Posted on 2011-05-02
2
Medium Priority
?
282 Views
Last Modified: 2012-05-11
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

0
Comment
Question by:lulu50
2 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 2000 total points
ID: 35508254
<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
 

Author Closing Comment

by:lulu50
ID: 35508413
Thank you
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question