> I did check the livedocs but did not understand,
Did you read this bit:
Index of the first list element that contains value, with matching case. If
not found, returns zero.
What does that suggest that it returns, to you?
> will find the desired value inside a list,
It returns the *index* of the match. Its position. So, from your list
"comments,other,active,sale", "other" is in position (index) 2. listFind()
will return 2 in this case.
> or only returns true (gt
> 0), as Dan's example show.
TRUE <> "gt 0". For one thing, negative numbers also evaluate as "true"
when cast to a boolean.
CF will automatically try to cast a value in an expression to a data type
that will enable the expression to not error. So when CF finds a numeric
in a boolean expression, it will cast it to a boolean. All non-zero
numbers will be cast to TRUE; zero will be cast to FALSE.
Note: in future when posting, please do not suggest something simply "does
not work". Please provide what it is that makes you think it doesn't work:
- an error message
- no error, but not what you werre expecting (and accordingly what your
expectation was, and how it wasn't met)
- any other useful information.
Saying "it didn't work" is vague and kind of taken as a given. People
seldom post here saying "hey, just to let you know, I was working on
something and it's all fine" ;-)