1 Reply Latest reply on Jul 19, 2006 5:28 AM by BKBK

    Setting array as list of cgi.script_name

      This should be a gimme, but I'm stumped. Check out this code. The final dump shows an empty array, what am I missing?

      Script name: <cfoutput>#cgi.SCRIPT_NAME#</cfoutput><BR>
      <cfset myList = cgi.scipt_name>
      <cfset myArray = arrayNew(1)>
      <cfloop list="#mylist#" delimiters="/" index="i">
      <cfset myArray = arrayAppend(myArray, i)>

      <cfdump var="#myArray#">
        • 1. Re: Setting array as list of cgi.script_name
          BKBK Adobe Community Professional & MVP
          1) a typo: <cfset myList = cgi.script_name>
          2) if you use both delimiters \ and /, you will not have to worry which one is required: <cfloop list="#mylist#" delimiters="\/" index="i">
          3) ArrayAppend() returns a boolean. You usually don't need to set it to anything, certainly not to an array: <cfset arrayAppend(myArray, i)>