The third argument of ListFind is not starting position but rather it is the lists delimiter. So your "1" and "2" delimited list does have exaclty 1 list item (as there are no 1's or 2's in your number).
----- Original Message -----
From: Seth Johnson
To: CF-Talk
Sent: Monday, November 24, 2003 4:14 PM
Subject: ListFind() weirdness
OK, so I'm having some weird behavior with ListFind() on CFMX and CF 5.
Here's an example. I create a COMMA DELIMITED list of values, each value
actually consists of 3 groups of numbers separated by an underscore.
ListFind() is not returning the proper result when this list contains a
single value.
<cfset lstTemp = "4483_035738_8647">
<cfoutput>
#ListFind(lstTemp, "4483_035738_8647")#<br>
#ListFind(lstTemp, "4483_035738_8647", 1)#<br>
#ListFind(lstTemp, "4483_035738_8647", 2)#<br>
</cfoutput>
All of the ListFind()s are returning a value of "1", even though they should
be returning 0.
In this case, the list and the value I'm looking for are one and the same,
so a straight ListFInd() should return an index of 1. However, if I call
ListFind() with a starting position of 1, shouldn't it return 0? It works
fine if the list contains more than one value, but not if it has just one
value.
Any help would be VERY much appreciated.
Seth Petry-Johnson
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]