>> So the above list has 3 values with each value enclosed
>> within the brackets.
>
>ColdFusion doesn't know that and is seeing ALL of the commas as list
>delimiters. You'll need to change the delimiter to something else and then
>break it apart:
>
><cfset list = "{x,x,x},{x,x,x},{x,x,x}" />
><cfset list = replace(list, "},{", "}#chr(255){" />
><cfset theArray = listToArray(list, chr(255)) />
>
>What we're doing here is changing the desired delimited (between the closing
>and opening brackets) to some other unused character (ascii 255 in this
>case) and then using that as the delimiter for the break, ignoring the
>commas entirely.
>
>
>-Justin
Thanks for replying. I get other problem now. The above list is converted as
below:
<cfset list = "{name:'col1'", "index:'col1'",
"sorttype:'string'"},{"name:'col2'", "index:'col2'",
"sorttype:'string'"},{"name:'col3'", "index:'col3'", "sorttype:'string'"}">
Each name:value is getting surrounded by double quotes. How to ignore these?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340529
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm