Hey all,
One of my team members just brought to me something strange that to me
seems as if it's a bug. If you use multiple delimiters to create a
list, and then use a single delimiter to fashion a sub-list, CF treats
the sub-list as two elements. Here is an example:
<cfset myList = 'element 1||element2||element3'>
<cfoutput>
Single list using || as delim <br><br>
length = #listLen(myList, '||')# <br> <!--- This will produce 3
as expected --->
element1 = #listFirst(myList, '||')# <br> <!--- 'element1' as
expected --->
element2 = #listGetAt(myList, 2, '||')# <br><!--- 'element2' as
expected --->
element3 = #listLast(myList, '||')# <br> <!--- 'element3' as
expected --->
</cfoutput>
<br>
<br>
<cfset myNewList = 'element 1||element2a|element2b||element3'>
<!--- now add a sub-list using a single pipe char --->
Sublist using | as delim in a list using || as delim
<cfoutput>
length = #listLen(myNewList, '||')# <br> <!--- returns 4?? --->
element1 = #listFirst(myNewList, '||')# <br><!--- 'element1' as
expected --->
element2 = #listGetAt(myNewList, 2, '||')# <br> <!---
'element2a' wth?!? This should return 'element2a|element2b' --->
element3 = #listLast(myNewList, '||')# <br> <!--- 'element3' as
expected --->
</cfoutput>
If I am explicitly telling CF that the delimiter is two pipes, why would
it stop when finding only one? I tried this with other delimiters and
found the same behavior. Am I crazy or does this appear to be a bug?
Rich Kroll
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:267725
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4