try changing the code to


function isListInList(lstFind, lstValues)
{
var delim1 = ",";
var delim2 = ",";
var i = 1;
var bMatchAnyItem = false;
var bFound = false;

if(ArrayLen(Arguments) GTE 3) delim1 = Arguments[3];
if(ArrayLen(Arguments) GTE 4) delim2 = Arguments[4];
if(ArrayLen(Arguments) GTE 5) bMatchAnyItem = Arguments[5];

for(i=1; i LTE ListLen(lstFind, delim1); i=i+1)
{
  if(bMatchAnyItem AND ListFind(lstValues, listGetAt(lstFind, i, delim1),
delim2))
  {
   bFound = true;
   break;
  }
  if(NOT bMatchAnyItem AND NOT ListFind(lstValues, listGetAt(lstFind, i
,delim1), delim2))
   return false;
}
return bFound;
}


and see if this helps, the version i have i modified to run slightly
different code (I beleive because of this problem, but as usual I didnt
comment why I did it)

-----Original Message-----
From: Bushy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 13, 2004 15:31
To: CF-Newbie
Subject: re: Using IsListInList UDF - thread continuation

Hi,

I'm hoping its just syntax but this UDF is not doing what I want it to do. I
think I got the syntax correct?

http://www.cflib.org/udf.cfm/islistinlist

My cookie contains the following example:

COOKIE.check = "contact,support,test,Administrators"

<cfif isListInList("Administrators,support","#COOKIE.check#",",",",",true)>
Show Prodcut
<cfelse>
Don't show product
</cfif>

When I run the above sample "Show Product" gets output.

If I change my cookie

COOKIE.check = "Users,System" and run the below:

<cfif isListInList("Administrators,support","#COOKIE.check#",",",",",true)>
Show Prodcut
<cfelse>
Don't show product
</cfif>

It outputs "Show Product"

Whats happening????
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to