While I think the suggestion of switching to BlueDragon is an excellent one
to consider, the following code works exactly the same on BD 6.2 and CFMX
6.1:

    <cfset list ="a,b,c,,,d">

    <cfoutput>
    #ListLen( list )#<br>
    #listGetAt( list, 4 )#
    </cfoutput>

As far as I know, all of the list functions work the same on BD as on CFMX.
We did, however add an optional enhancement to the ListToArray() function;
from the BlueDragon 6.2 CFML Enhancements Guide:

        "BlueDragon adds a new third argument to ListToArray(), a boolean
value, which determines whether to include empty list elements in the
resulting array. The default is no, which causes it to operate consistently
with ColdFusion. Consider the following:

    <cfset list = "1,2,,3">
    <cfdump var="#listToArray(list,",")#">

        Both ColdFusion and BlueDragon will return an array of 3 elements,
even though there are 4 items in the list, the third of which is empty. Use
the newly available third argument to change this behavior:

    <cfset list = "1,2,,3">
    <cfdump var="#listToArray(list,",","yes")#">

        This creates instead an array of 4 elements, with the third being
empty."

Maybe this is what Adam was thinking of?

Vince Bonfanti
New Atlanta Communications, LLC
http://www.newatlanta.com


> -----Original Message-----
> From: Adam Haskell [mailto:[EMAIL PROTECTED] 
> Sent: Monday, March 07, 2005 8:50 AM
> To: CF-Talk
> Subject: Re: ColdFusion ignores empty list elements
> 
> Switch to Bluedragon :) 
> 
> Also I use the split UDF on CFlib, works very nicely, The 
> pure java solution is one of the best Ideas, but we are on 
> *sigh* CF 5 so I don't have that luxury personally :)
> 
> Adam H
> 
> 
> On Mon, 07 Mar 2005 06:56:02 -0400, cf coder 
> <[EMAIL PROTECTED]> wrote:
> > ex: the list "a,b,c,,,d" has four elements
> > 
> > How do I force it to not ignore empty elements? I'm getting 
> an error with listGetAt(list,4). Any thoughts?
> > 
> > Best regards
> > cfcoder
> >



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:197761
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to