Mar
08
08
So I’m working on (what I’d consider a very small) problem: I need to convert a string to an array, then loop that array and do ’something’ to each value.
For some reason, that’s beyond my understanding, I can’t get the following code to work (I get ‘invalid com/struct’ errors):
-
<cfset MyList = "1,2,3,4">
-
<cfset MyArray = ListToArray(MyList)>
-
<cfloop collection="#MyArray#" item="i">
-
<cfoutput>#i#:#MyArray[i]#</cfoutput>
-
</cfloop>


Categories