Carlo,
Try adding the delimiter:
listcontains(newlist, "#pageid#", ",")
"van Wyk, Carlo" wrote:
>
> Hi
>
> I have the following piece of code that checks to see if a user can see a
> specific pageid or not. Unfortunately it is not doing the job as I have a
> list that looks something like thi
he Holy Bible: http://www.bibleclicks.com
- Original Message -
From: David Burt <[EMAIL PROTECTED]>
To: CF-Talk <[EMAIL PROTECTED]>
Sent: Wednesday, September 19, 2001 7:53 AM
Subject: Re: Listcontains question
> > 4,14,3,2,8,44
> >
> > If the user is allowed to see page 4,
Carlo,
ListContains works correctly as described in the Language reference. For
what you want, check out ListFind and ListFindNoCase.
Nelson
- Original Message -
From: "van Wyk, Carlo" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, September 19, 2001 5:27 AM
S
Use ListFind() instead
---
Billy Cravens
Web Development, EDS
[EMAIL PROTECTED]
-Original Message-
From: van Wyk, Carlo [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 19, 2001 4:28 AM
To: CF-Talk
Subject: Listcontains question
Hi
I have the following piece of code that check
for that type of comparison, you might be better served staying away from
the listfind or listcontains functions.
try something like
#application.securityerror#
Yes, it is slower, but it would be doing the type of comparisons t
Hi , Please use ListFind(newlist,"4").
There is a difference between listcontains and ListFind, somehow, the
following code will print "index:2","index2:5":
index: #index#
index2: #index2#
According to the documenttation:
ListFind:Returns the index of the first occurrence of a value within a
do a list loop instead. it loops through the list and checks it with the
number u are looking for (line 5). If it matches, it includes the tmeplate
and breaks off the loop. Then on line 11 it checks to see if it has checked
through everything in the list, and if it has and has gotten this far
Try using the listFind() function instead.
-Tyson
-Original Message-
From: van Wyk, Carlo [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 19, 2001 4:28 AM
To: CF-Talk
Subject: Listcontains question
Hi
I have the following piece of code that checks to see if a user can see a
spec
Yes listcontains will do this!
What you might need to do is something like this:-) Turn the list into
an array, then run a loop until you find the first occurrence.
Regards,
Andrew Scott
-Original Message-
From: van Wyk, Carlo [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 19 September 2
2 Possible Solutions off the top of my head:
1. Use List Qualify and then add qualifiers around the data being passed.
2. Use the UDF Below if you're running CF5. This is essentially the same as
above, just in UDF form so that it's easy to remember.
usage: #ListContainsUnique(yourlist,'4')#
fun
Good morning,
The ListContains function does not work as you wish it to. You should use
the ListFind and ListFindNoCase functions. Here is what the docs say about
ListFind. I use this quite a bit.
ListFind
Returns the index of the first occurrence of a value within a list. Returns
0 if n
> 4,14,3,2,8,44
>
> If the user is allowed to see page 4, then he would be able to see all
pages
> that contains a 4, so it does not work correctly.
This code should be what you need:
If the user is allowed to see page 4, then he would be able to see all pages
that contains a 4, so it does not w
Try using a structure and using Struct Funtions like Find, Get etc...
~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: ht
Try ListFind()
Also (if you can) build your lists with a "good" delimiter. the Bell
character is great.
ListAppend(YourList,YourListItem,chr(7))
Then: ListFind(YourList,AnItem,chr(7))
> Hi
>
> I have the following piece of code that checks to see if a user can see a
> specific pageid or not.
You should use ListFind rather than ListContains
--- "van Wyk, Carlo" <[EMAIL PROTECTED]>
wrote:
>
>
>
>
> #application.securityerror#
>
>
>
> Regards
> Carlo
=
I-Lin Kuo
Macromedia CF5 Advanced Developer
Sun Certified Java 2 Programmer
~~~
Hi Carlo,
> If the user is allowed to see page 4, then he would be able to see all
> pages that contains a 4, so it does not work correctly.
>
>
>
>
(snipped)
Try using ListFind instead of ListContains. ListContains will find list
elements which contain your search string in any
16 matches
Mail list logo