I guess a good compromise would be a second ListLenCountingBlanks function would be handy.
Or a CountElement() function where you pass in a string and tell it a substring to return the number of occurances for.
so you could say

<cfset myLIst = "a,,b,c,,h" />


#CountElement(myList,",")+1#  <!--- returns the length of my list including empty slots (6)--->

#ListLen(myList)# <!--- returns the length of my list ignoring empty slots (4) --->


I agree we can't have MM changing the definition of ListLen - way, way, way too many existing apps would break

Bill



On 5/12/05, Barney Boisvert <[EMAIL PROTECTED]> wrote:
My point was that there are at least three differing perspectives on
"proper" handling of that list.  I'm not saying CF's is right, but the
simple fact that that's the way it's always been requires a little
more than "well I think" logic to instigate a change.

And since CF equates the empty string to null, and null means "doesn't
exist", then ignoring empty elements makes sense.

cheers,
barneyb

On 5/12/05, Roland Collins <[EMAIL PROTECTED]> wrote:
> Even if you _tell_ CF that "," is the delimiter, it still treats ("1,,2,,3")
> as length 3.  That's wrong.  It should be 3 numbers and 2 nulls, or at least
> 3 numbers and 2 empty strings.  Also, if you add a space in there ("1, ,2,
> ,3"), it correctly returns 5 as the length.
>
> :-S
>
> Roland

--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 50 invites.

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]




--
[EMAIL PROTECTED]
http://blog.rawlinson.us

If you want Gmail - just ask. ----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

Reply via email to