RE: JavaScript version of listContains()

2008-01-18 Thread Bobby Hartsfield
http://acoderslife.com -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Friday, January 18, 2008 12:16 PM To: CF-Talk Subject: SOT: JavaScript version of listContains() Does anybody know if there is a simple, basic JavaScript equivalent of the CFML listContains

Re: SOT: JavaScript version of listContains()

2008-01-18 Thread Charlie Griefer
On Jan 18, 2008 9:35 AM, Claude Schneegans [EMAIL PROTECTED] wrote: that's not to say there's not a simple way tho. The only other way I can think of is using regExp, but not really simpler. yeah, i thought about using subStr... but then you'd have to check for an optional comma in front and

SOT: JavaScript version of listContains()

2008-01-18 Thread Ian Skinner
Does anybody know if there is a simple, basic JavaScript equivalent of the CFML listContains() function that can determine if a given value is one of four possible values. TIA Ian ~| Adobe® ColdFusion® 8 software 8

Re: SOT: JavaScript version of listContains()

2008-01-18 Thread Ian Skinner
Claude Schneegans wrote: that's not to say there's not a simple way tho. The only other way I can think of is using regExp, but not really simpler. Actually after thinking on this a bit it turned out to be fairly simple. At least for my immediate need of 6 possible 1 character values.

Re: JavaScript version of listContains()

2008-01-18 Thread Aaron Rouse
I do not know if it is the same person, but there is a CF JS function plugin for jQuery. http://cfjs.riaforge.org/ I did not look to see if it has listcontains or not, just assumed it does. On Jan 18, 2008 11:38 AM, Jerry Guido [EMAIL PROTECTED] wrote: Not exactly. But close. ListFind

Re: SOT: JavaScript version of listContains()

2008-01-18 Thread Qasim Rasheed
sorry, I responded too quick. This will actually be ListFind and not ListContains. On Jan 18, 2008 2:32 PM, Qasim Rasheed [EMAIL PROTECTED] wrote: I am hoping this will work function ListContains(list,item,delim){ var del = (delim == null)? ,: delim; return list.split(del).indexOf

Re: SOT: JavaScript version of listContains()

2008-01-18 Thread Qasim Rasheed
I am hoping this will work function ListContains(list,item,delim){ var del = (delim == null)? ,: delim; return list.split(del).indexOf(item) != -1; } On Jan 18, 2008 12:38 PM, Charlie Griefer [EMAIL PROTECTED] wrote: On Jan 18, 2008 9:35 AM, Claude Schneegans [EMAIL PROTECTED] wrote

RE: JavaScript version of listContains()

2008-01-18 Thread Jerry Guido
PROTECTED] Sent: Friday, January 18, 2008 12:16 PM To: CF-Talk Subject: SOT: JavaScript version of listContains() Does anybody know if there is a simple, basic JavaScript equivalent of the CFML listContains() function that can determine if a given value is one of four possible values. TIA Ian

RE: JavaScript version of listContains()

2008-01-18 Thread Jerry Guido
received this transmittal in error; any review, dissemination, distribution or copying of this transmittal is strictly prohibited. -Original Message- From: Aaron Rouse [mailto:[EMAIL PROTECTED] Sent: Friday, January 18, 2008 2:42 PM To: CF-Talk Subject: Re: JavaScript version of listContains

Re: JavaScript version of listContains()

2008-01-18 Thread Claude Schneegans
The guy from leftcorner.com (offline) ported a bunch of CF functions to JS. I still have a copy. Pretty handy. Pretty handy indead. Javascript looks like a retarded language when dealing with strings. Thanks. -- ___ REUSE CODE! Use custom tags; See

Re: SOT: JavaScript version of listContains()

2008-01-18 Thread Claude Schneegans
that's not to say there's not a simple way tho. The only other way I can think of is using regExp, but not really simpler. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address:

Re: SOT: JavaScript version of listContains()

2008-01-18 Thread Charlie Griefer
and suggested my long-ass way that jim davis comes along and says, sure... just use __ (and he's right, dammit) :) On Jan 18, 2008 9:16 AM, Ian Skinner [EMAIL PROTECTED] wrote: Does anybody know if there is a simple, basic JavaScript equivalent of the CFML listContains() function that can

listcontains

2003-08-01 Thread Wurst, Keith D.
i have a list like this... 15,0,2,5 when i run a listcontains on it for the number 1 - i get back a positive response. i guess it is seeing the 1 in 15 and telling me that 1 exists in that list. cfif #listcontains(#pick_list#,1,,)# any way to have it look for 15 specifically, and not 1

RE: listcontains

2003-08-01 Thread David Collie (itndac)
ListFind -Original Message- From: Wurst, Keith D. [mailto:[EMAIL PROTECTED] Sent: 01 August 2003 16:11 To: CF-Talk Subject: listcontains i have a list like this... 15,0,2,5 when i run a listcontains on it for the number 1 - i get back a positive response. i guess it is seeing the 1

RE: listcontains

2003-08-01 Thread Dave Wilson
Try listfind instead -Original Message- From: Wurst, Keith D. [mailto:[EMAIL PROTECTED] Sent: 01 August 2003 16:11 To: CF-Talk Subject: listcontains i have a list like this... 15,0,2,5 when i run a listcontains on it for the number 1 - i get back a positive response. i

RE: listcontains

2003-08-01 Thread Andy Ousterhout
listfind -Original Message- From: Wurst, Keith D. [mailto:[EMAIL PROTECTED] Sent: Friday, August 01, 2003 10:11 AM To: CF-Talk Subject: listcontains i have a list like this... 15,0,2,5 when i run a listcontains on it for the number 1 - i get back a positive response. i guess

ListContains NOT functioning properly - Help!

2002-03-05 Thread Mark M. Kecko
Help! When I'm looping over a list Campaign.Vehicles that's coming from a SQL table varchar field I'm getting strange results from ListContains. Looping over Vehicles.code= siteMinute,siteNews,site,siteSpin,mi,os,ol,mn,siteHome - several rows from a database call. Campaign.Vehicles=siteMinute

RE: ListContains NOT functioning properly - Help!

2002-03-05 Thread Raymond Camden
ListCOntains returns the index, not the # of matches. === Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email: [EMAIL PROTECTED] Yahoo IM : morpheus My ally is the Force, and a powerful ally

ListContains NOT functioning properly - MORE!

2002-03-05 Thread Mark M. Kecko
cfoutputinput class=text type=checkbox name=#i# cfif ListContains(#Vehicles#, #i#)checked/cfif nbsp;#i#br/cfoutput /cfloop Mark Kecko The Computer Guy MediaPost Communications [EMAIL PROTECTED] http://www.mediapost.com (203)222-0330 ext309 Imagination is the one weapon in the war against

RE: ListContains NOT functioning properly - MORE!

2002-03-05 Thread Kevin Cundick
Looks to me like you ListContains function needs a delimiter. ListContains(#Vehicles#, #i#, ,) Hope that helps. Kevin -Original Message- From: Mark M. Kecko [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 10:43 AM To: CF-Talk Subject: ListContains NOT functioning

Sorry to flood the List BUT.... ListContains NOT functioning properly!

2002-03-05 Thread Mark M. Kecko
,siteHome cfset Vehicles=siteMinute,siteNews,siteSpin cfloop list=#codes# index=i cfoutputinput class=text type=checkbox name=#i# cfif ListContains(#Vehicles#, #i#)checked/cfif nbsp;#i#br/cfoutput /cfloop Mark Kecko The Computer Guy MediaPost Communications [EMAIL PROTECTED

RE: Sorry to flood the List BUT.... ListContains NOT functioning properly!

2002-03-05 Thread kbutterly
to flood the List BUT ListContains NOT functioning properly! Sorry, but... Why does the below code check 4 boxes when there's only 3 items in the List??? Please help!!! This is costing my company a good deal of cash! - Just copy and paste the code into a test page and run it, you'll see, I hope

RE: Sorry to flood the List BUT.... ListContains NOT functioning properly!

2002-03-05 Thread Semrau, Steven L Mr RDAISA/SRA
The function (ListContains) is doing exactly what it's suppose to and I can see why it's returning 4. ListContains: Returns the index of the first item that contains a specified substring. The search is case-sensitive. If the substring is not found in the list items, it returns zero (0

RE: Sorry to flood the List BUT.... ListContains NOT functioning properly!

2002-03-05 Thread Dan G. Switzer, II
Mark, You want to use ListFind(), not ListContains() in your example below. ListContains() is going to return a position for site since site is contained in siteMinute, siteNews, site and siteSpin. ListFind() will only find matching values. ListContains() will return a match if the string being

RE: Sorry to flood the List BUT.... ListContains NOT functioning properly!

2002-03-05 Thread Chip Griffin
I think you may want to use ListFind instead. That will generate the intended result, I believe. ListFind checks the entire list element whereas ListContains looks at any part of a list element. -Original Message- From: Mark M. Kecko [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05

Re: Sorry to flood the List BUT.... ListContains NOT functioning properly!

2002-03-05 Thread Matthew Walker
You want ListFind() :-) - Original Message - From: [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, March 06, 2002 7:57 AM Subject: RE: Sorry to flood the List BUT ListContains NOT functioning properly! Isn't it because spin IS contained in the list? in siteSpin

Re: Listcontains question

2001-09-20 Thread Nelson Winters
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 Subject

Re: Listcontains question

2001-09-20 Thread Tony Hicks
://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, then he would be able to see all pages that contains a 4

Re: Listcontains question

2001-09-20 Thread John Allred
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

Listcontains question

2001-09-19 Thread van Wyk, Carlo
a 4, so it does not work correctly. cfif listcontains(newlist, #pageid#) cfinclude template=#page# cfelse cfoutput #application.securityerror# /cfoutput /cfif Regards Carlo FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail

RE: Listcontains question

2001-09-19 Thread Colin Fyfe
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. cfif listcontains(newlist, #pageid#) cfinclude template=#page# (snipped) Try using ListFind instead of ListContains. ListContains

Re: Listcontains question

2001-09-19 Thread cf refactoring
You should use ListFind rather than ListContains --- van Wyk, Carlo [EMAIL PROTECTED] wrote: cfif listcontains(newlist, #pageid#) cfinclude template=#page# cfelse cfoutput #application.securityerror# /cfoutput /cfif Regards Carlo = I-Lin

Re: Listcontains question

2001-09-19 Thread Joseph Thompson
or not. Unfortunately it is not doing the job as I have a list that looks something like this: 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. cfif listcontains(newlist, #pageid#) cfinclude template=#page

RE: Listcontains question

2001-09-19 Thread Neil Clark
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:

Re: Listcontains question

2001-09-19 Thread David Burt
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 work

RE: Listcontains question

2001-09-19 Thread Don Lundgren
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

RE: Listcontains question

2001-09-19 Thread Joshua Miller
); if(ListContains(list,compare,delim)){ return true; }else{ return false; } } Joshua Miller Web Development::Programming Eagle Technologies Group, Inc. www.eagletgi.com [EMAIL PROTECTED] -Original Message- From: van Wyk, Carlo [mailto

RE: Listcontains question

2001-09-19 Thread Andrew Scott
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

RE: Listcontains question

2001-09-19 Thread Tyson Vanek
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

Re: Listcontains question

2001-09-19 Thread Koo Pai Lao
. #application.securityerror# 15. /cfoutput 17. /CFIF 18. /CFLOOP From: van Wyk, Carlo [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Subject: Listcontains question Date: Wed, 19 Sep 2001 11:27:54 +0200 Hi I have the following piece of code that checks to see

RE: Listcontains question

2001-09-19 Thread Sima Lee
Hi , Please use ListFind(newlist,4). There is a difference between listcontains and ListFind, somehow, the following code will print index:2,index2:5: cfset newlist=1,44,5,40,4,50 cfset index=listContains(newlist,4) cfset index2=listFind(newlist,4) cfoutputindex: #index#br index2: #index2

RE: Listcontains question

2001-09-19 Thread Matthew W Jones
for that type of comparison, you might be better served staying away from the listfind or listcontains functions. try something like cfset authorized = false cfloop list=#newlist# index=accessiblePage cfif accessiblePage eq pageid cfset authorized = true /cfif

RE: Listcontains question

2001-09-19 Thread Billy Cravens
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

RE: ListContains wierdness - why?

2000-12-03 Thread Scott, Andrew
Hmmm, I think you found a bug! regards Andrew Scott Senior Cold Fusion Application Developer ANZ eCommerce Centre * Ph 9273 0693 * [EMAIL PROTECTED] -Original Message- From: Park, Simon [mailto:[EMAIL PROTECTED]] Sent: 01 December 2000 06:47 To: CF-Talk Subject: ListContains

RE: ListContains wierdness - why?

2000-12-03 Thread BORKMAN Lee
No, this isn't a bug. According to the documentation, ListContains returns the index of the first list element THAT CONTAINS THE SPECIFIED SUBSTRING. Your code returns true because the substring "1" is contained in the list element "10". So it doesn't really do what you

RE: ListContains wierdness - why?

2000-12-03 Thread Scott, Andrew
an element in this example regards Andrew Scott Senior Cold Fusion Application Developer -Original Message- From: BORKMAN Lee [mailto:[EMAIL PROTECTED]] Sent: 04 December 2000 12:06 To: CF-Talk Subject: RE: ListContains wierdness - why? No, this isn't a bug. According to the documentation, Li

Re: ListContains wierdness - why?

2000-12-03 Thread Jim McAtee
It's not a bug. If it worked the same as ListFind() what would be the point of the function? I honestly can't think of a good use for the ListContains() function, but that's another matter. It certainly seems to cause more confusion than anything. Jim - Original Message - From

RE: ListContains wierdness - why?

2000-12-03 Thread Scott, Andrew
: ListContains wierdness - why? It's not a bug. If it worked the same as ListFind() what would be the point of the function? I honestly can't think of a good use for the ListContains() function, but that's another matter. It certainly seems to cause more confusion than anything. Jim - Original

RE: ListContains wierdness - why?

2000-12-01 Thread Jared Clinton
Try using a listfind instead of a listcontains, then re-read the help pages for both functions carefully. Jared Clinton. -Original Message- From: Park, Simon [mailto:[EMAIL PROTECTED]] Sent: Friday, 1 December 2000 6:47 To: CF-Talk Subject: ListContains wierdness - why? Why

Re: ListContains wierdness - why?

2000-12-01 Thread David Shadovitz
Because there's a "1" in the list, in the value "10". Try ListFind rather than ListContains. -David On Thu, 30 Nov 2000 14:47:29 -0500 "Park, Simon" [EMAIL PROTECTED] writes: Why does the following always return TRUE? CFSET FooList = "6,7,8,9,10"

RE: ListContains wierdness - why?

2000-12-01 Thread Rob Cawte
Simon, You want ListFind. ListContains returns true because the list contains a "1" ... it's part of the "10" i.e. ListFind to find list elements, ListContains to find substrings within elements. -Rob -Original Message- From: Park, Simon [mailto:[EMAIL PROT

Re: ListContains wierdness - why?

2000-12-01 Thread Dick Applebaum
Try ListFind At 2:47 PM -0500 11/30/00, Park, Simon wrote: Why does the following always return TRUE? CFSET FooList = "6,7,8,9,10" CFIF ListContains(VARIABLES.FooList, "1") TRUE CFELSE FALSE /CFIF Do I need to put the

Re: ListContains wierdness - why?

2000-12-01 Thread Kym Kovan
Hi Simon, Why does the following always return TRUE? CFSET FooList = "6,7,8,9,10" CFIF ListContains(VARIABLES.FooList, "1") ListContains() searches for substrings in the list so it is true, there is a "1" in the list part of the "10". Us

Re: ListContains wierdness - why?

2000-12-01 Thread pan
Why does the following always return TRUE? CFSET FooList = "6,7,8,9,10" CFIF ListContains(VARIABLES.FooList, "1") TRUE CFELSE FALSE /CFIF You are about to discover the difference between ListContains and ListFind. ListContains will return true if substring

Re: ListContains wierdness - why?

2000-12-01 Thread Jeffry Houser
a comma and a zero. "Park, Simon" wrote: Why does the following always return TRUE? CFSET FooList = "6,7,8,9,10" CFIF ListContains(VARIABLES.FooList, "1") TRUE CFELSE FALSE /CFIF Do I need to put the values into an array? =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

RE: ListContains wierdness - why?

2000-12-01 Thread Patricia Lee
00 9:12 AM To: CF-Talk Subject: Re: ListContains wierdness - why? As a general rule, arrays are more efficient than lists. Lists are implemented as strings, so every action on them is done as string processing. Arrays are implemented natively. Based on that (Without actual

RE: ListContains wierdness - why?

2000-12-01 Thread Christopher Olive, CIO
[EMAIL PROTECTED] http://www.crescotech.com -Original Message- From: Jeffry Houser [mailto:[EMAIL PROTECTED]] Sent: Friday, December 01, 2000 9:12 AM To: CF-Talk Subject: Re: ListContains wierdness - why? As a general rule, arrays are more efficient than lists. Lists are implemented

ListContains wierdness - why?

2000-11-30 Thread Park, Simon
Why does the following always return TRUE? CFSET FooList = "6,7,8,9,10" CFIF ListContains(VARIABLES.FooList, "1") TRUE CFELSE FALSE /CFIF Do I need to put the values into an array? =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Simon Park Computer Sys