Try the ListLen() function. This should give you the number of elements
(words) in your field.
ListLen(List, [delimiter])
HTH,
Jeff Garza
Lead Developer/Webmaster
Spectrum Astro, Inc.
480.892.8200
[EMAIL PROTECTED]
http://www.spectrumastro.com
-Original Message-
From: Perez,
Just see how long the list is.
ListLen(mylist, )
Phillip
-Original Message-
From: Perez, Bismark [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 18, 2001 9:20 AM
To: CF-Talk
Subject: Counting the number of words in a field
Is there a way to accomplish this?
I have a database
Treat the field as a list with space as delimiters:
cfset list = one twothree
cfoutput#listlen(list, )#/cfoutput
CF doesn't count empty list members, so no matter how much consecutive white
space you have between words, this will still return the correct number.
Wow, here's the one time when that behavoir (counting consecutive
delimiters as one) would be appropriate!
Treat the field as a list with space as delimiters:
cfset list = one twothree
cfoutput#listlen(list, )#/cfoutput
CF doesn't count empty list members, so no
FYI, if anyone is interesting in a UDF that will convert:
a,,b
to
a,,b
Check out cflib.org. I posted a UDF, ListFix, last week that does this.
It essentially takes care of lists that need to have null entries
counted.
===
5 matches
Mail list logo