More CF lovin’

The code…

<cfset aList="12, 14, 15">
<cfif ListContains(aList, 2)>
    Yeah!
</cfif>

The assumption…
The number 2 is not present in the list.

The reality…
The character “2″ is present in the list since ListContains() does a substring search.

The reaction…
Grrrrrrr!

(Apparently I should have been using ListFind)

1 Comment »

  1. pimaster said,

    April 7, 2008 @ 4:19 pm

    I had to look that up to make sure it is funny.
    http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000549.htm
    … and it is funny :D

RSS feed for comments on this post

Leave a Comment