1 Reply Latest reply on Nov 8, 2006 2:45 PM by Newsgroup_User

    outputting all local variables on a page

    Level 7
      Im debugging and testing code. the line below should set a variable called
      backorder340

      Is there a way in coldfusion to dump all the local variable values and the
      variable names even if you dont know the variables names?

      Also is that the correct syntax below to use a variable value in a variable
      name?


      <cfset backorderquery.line[loopcount]=
      #query.QtyOrdered[loopcount]# -(#TotQtyInvoiced#)>


        • 1. Re: outputting all local variables on a page
          Level 7
          <cfdump var="#variables#"> As long as you are using a relatively recent
          version of ColdFusion.

          <quote>
          Also is that the correct syntax below to use a variable value in a
          variable name?

          <cfset backorderquery.line[loopcount]=
          #query.QtyOrdered[loopcount]# -(#TotQtyInvoiced#)>
          </quote>

          I don't think so. I suspect you are trying to do something like this.

          <cfset variables["backorder" & loopCount] = query.QtyOrdered[loopCount]
          - TotQtyInvoiced>