LionelR wrote:
> Can someone show me how to reproduce this with a CFLOOP?
Just think through what you need to do in general terms
first. It seems as if you need take three variables:
colorID1, colorID2, colorID3
.. and split each one into two parts:
colorID1_1, colorID1_2
colorID2_1, colorID2_2
colorID3_1, colorID3_2
So roughly speaking you want to
1. Loop three times
2. Within each loop, split the current variable into two
parts
The rest is just becomes a matter of constructing the dynamic
variable names using array notation.
<cfloop from="1" to="3" index="suffix">
<cfset variables["colorid"& suffix &"_1"] =
ListGetAt(variables["colorid"& suffix],1)>
<cfset variables["colorid"& suffix &"_2"] =
ListGetAt(variables["colorid"& suffix], 2)>
</cfloop>
<cfdump var="#variables#">