output an array

Posted on 2011-05-02
Last Modified: 2012-05-11

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 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="'#93b38e'" onMouseOut="'#000000'"><cfoutput>#Array Name should be here#</cfoutput></a>


Open in new window

Question by:lulu50
    LVL 51

    Accepted Solution

    <cfoutput>#Array Name should be here#</cfoutput>

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


    Open in new window

    But why do you even need an array? It's much simpler to output your original query.

    Author Closing Comment

    Thank you

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
    Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    758 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

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now