RE: Compare List

2004-03-15 Thread Brendan Avery
That's what the ListSort function embedded in the Compare function was
for.As long as both lists contain the exact same entities it doesn't
matter if they're in different orders if you embed those ListSort
functions.Perhaps my code was unclear.Here let me elaborate:

cfset list1=1,2,3,4,5
cfset list2=3,1,2,5,4
cfset result=Compare(ListSort(list1,text),ListSort(list2,text))
cfif result IS 0
	THEY ARE THE SAME!!
cfelse
	THEY ARE NOT THE SAME!!
/cfif

;-P

Maybe that wasn't the point of your question though-- I think your
algorithm for doing the list compare is valid and beautiful in any case.
Its just not necessary to do it algorithmically when CF is so generous
with its List related functions.

Peace!

-b

-Original Message-
From: Greg Luce [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 6:43 PM
To: CF-Talk
Subject: RE: Compare List

Brendan,
	What would you use to for the sort order? These lists can be in
any order. Such as:
1,2,3,4,5
And
3,1,2,5,4

How would you compare these 2 lists using these functions?

Greg

-Original Message-
From: Brendan Avery [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 5:29 PM
To: CF-Talk
Subject: RE: Compare List

Compare(ListSort(list1,text),ListSort(list2,text)

Boo-yah.

== Brendan Avery -- http://www.brendanavery.com ==

-Original Message-
From: Greg Luce [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 1:40 PM
To: CF-Talk
Subject: RE: Compare List

You're looking for a match where both lists contain the same values, but
possibly in different orders right? I would try:

cfset state_list = 1,2,3,4,5,6,7,8
cfset query_list = 9,8,7,6,5,4,3,2

cfif listlen(state_list) EQ listlen(query_list)
cfloop index=i list=#state_list#
 cfif NOT listcontains(query_list, i)
Not A Complete Matchcfabort
 /cfif
/cfloop
Lists Match
cfelse
Not Same Length Match
/cfif

Greg

-Original Message-
From: cfhelp [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 2:13 PM
To: CF-Talk
Subject: Compare List

Will Compare(String1,String2) work to compare a list?

I have a Comma Delimited list of GUIDS (up to 50 for each state). That I
need to compare to a list GUIDS from a Query. If they match then return
true (1). 

The GUIDS in the list may not be in the same order as the GUIDS from the
query.

Any ideas?

Rick

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.583 / Virus Database: 369 - Release Date: 2/10/2004
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Compare List

2004-03-15 Thread Pascal Peters
This will not always work, you need to use ListFind (or ListFindNoCase)
instead of ListContains. Otherwise 2,9,7 and 2,7,99 will return
true.

Also, put a cfbreak in the loop if it is not a match.

Pascal

 -Original Message-
 From: cfhelp [mailto:[EMAIL PROTECTED] 
 Sent: maandag 15 maart 2004 2:43
 To: CF-Talk
 Subject: RE: Compare List
 
 Worked Perfect!

 Thanks 

 Rick

 -Original Message-
 From: Greg Luce [mailto:[EMAIL PROTECTED]
 Sent: Sunday, March 14, 2004 1:40 PM
 To: CF-Talk
 Subject: RE: Compare List

 You're looking for a match where both lists contain the same 
 values, but possibly in different orders right? I would try:
 
 cfset state_list = 1,2,3,4,5,6,7,8
 cfset query_list = 9,8,7,6,5,4,3,2
 
 cfif listlen(state_list) EQ listlen(query_list)
cfloop index=i list=#state_list#
cfif NOT listcontains(query_list, i)
 Not A Complete Matchcfabort
/cfif
/cfloop
Lists Match
 cfelse
Not Same Length Match
 /cfif
 
 Greg

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Compare List

2004-03-15 Thread Greg Luce
Brendan,
	I see now. Very nice.

Greg

-Original Message-
From: Brendan Avery [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 15, 2004 4:27 AM
To: CF-Talk
Subject: RE: Compare List

That's what the ListSort function embedded in the Compare function was
for.As long as both lists contain the exact same entities it doesn't
matter if they're in different orders if you embed those ListSort
functions.Perhaps my code was unclear.Here let me elaborate:

cfset list1=1,2,3,4,5
cfset list2=3,1,2,5,4
cfset result=Compare(ListSort(list1,text),ListSort(list2,text))
cfif result IS 0
	THEY ARE THE SAME!!
cfelse
	THEY ARE NOT THE SAME!!
/cfif

;-P

Maybe that wasn't the point of your question though-- I think your
algorithm for doing the list compare is valid and beautiful in any case.
Its just not necessary to do it algorithmically when CF is so generous
with its List related functions.

Peace!

-b

-Original Message-
From: Greg Luce [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 6:43 PM
To: CF-Talk
Subject: RE: Compare List

Brendan,
	What would you use to for the sort order? These lists can be in
any order. Such as: 1,2,3,4,5 And 3,1,2,5,4

How would you compare these 2 lists using these functions?

Greg

-Original Message-
From: Brendan Avery [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 5:29 PM
To: CF-Talk
Subject: RE: Compare List

Compare(ListSort(list1,text),ListSort(list2,text)

Boo-yah.

== Brendan Avery -- http://www.brendanavery.com ==

-Original Message-
From: Greg Luce [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 1:40 PM
To: CF-Talk
Subject: RE: Compare List

You're looking for a match where both lists contain the same values, but
possibly in different orders right? I would try:

cfset state_list = 1,2,3,4,5,6,7,8
cfset query_list = 9,8,7,6,5,4,3,2

cfif listlen(state_list) EQ listlen(query_list)
cfloop index=i list=#state_list#
 cfif NOT listcontains(query_list, i)
Not A Complete Matchcfabort
 /cfif
/cfloop
Lists Match
cfelse
Not Same Length Match
/cfif

Greg

-Original Message-
From: cfhelp [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 2:13 PM
To: CF-Talk
Subject: Compare List

Will Compare(String1,String2) work to compare a list?

I have a Comma Delimited list of GUIDS (up to 50 for each state). That I
need to compare to a list GUIDS from a Query. If they match then return
true (1). 

The GUIDS in the list may not be in the same order as the GUIDS from the
query.

Any ideas?

Rick

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.583 / Virus Database: 369 - Release Date: 2/10/2004
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Compare List

2004-03-15 Thread Christopher Farino
unsubscribe
- Original Message - 
From: Bernd VanSkiver 
To: CF-Talk 
Sent: Monday, March 15, 2004 1:03 AM
Subject: RE: Compare List

The ListSort() function sorts the lists and puts them in the same order
and then the Compare() checks if the lists are the same.

Bernd VanSkiver
[EMAIL PROTECTED]
801.520.5957

-Original Message-
From: Greg Luce [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 5:43 PM
To: CF-Talk
Subject: RE: Compare List

Brendan,
What would you use to for the sort order? These lists can be in
any order. Such as: 1,2,3,4,5 And 3,1,2,5,4

How would you compare these 2 lists using these functions?

Greg

-Original Message-
From: Brendan Avery [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 5:29 PM
To: CF-Talk
Subject: RE: Compare List

Compare(ListSort(list1,text),ListSort(list2,text)

Boo-yah.

== Brendan Avery -- http://www.brendanavery.com ==

-Original Message-
From: Greg Luce [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 1:40 PM
To: CF-Talk
Subject: RE: Compare List

You're looking for a match where both lists contain the same values, but
possibly in different orders right? I would try:

cfset state_list = 1,2,3,4,5,6,7,8
cfset query_list = 9,8,7,6,5,4,3,2

cfif listlen(state_list) EQ listlen(query_list)
 cfloop index=i list=#state_list#
cfif NOT listcontains(query_list, i)
Not A Complete Matchcfabort
/cfif
 /cfloop
 Lists Match
cfelse
 Not Same Length Match
/cfif

Greg

-Original Message-
From: cfhelp [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 2:13 PM
To: CF-Talk
Subject: Compare List

Will Compare(String1,String2) work to compare a list?

I have a Comma Delimited list of GUIDS (up to 50 for each state). That I
need to compare to a list GUIDS from a Query. If they match then return
true (1). 

The GUIDS in the list may not be in the same order as the GUIDS from the
query.

Any ideas?

Rick

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.583 / Virus Database: 369 - Release Date: 2/10/2004
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Compare List

2004-03-15 Thread Tangorre, Michael
Go to the HOF site to unsubscribe.

 -Original Message-
 From: Christopher Farino [mailto:[EMAIL PROTECTED] 
 Sent: Monday, March 15, 2004 8:23 AM
 To: CF-Talk
 Subject: Re: Compare List
 
 unsubscribe
- Original Message -
From: Bernd VanSkiver
To: CF-Talk
Sent: Monday, March 15, 2004 1:03 AM
Subject: RE: Compare List
 
The ListSort() function sorts the lists and puts them in 
 the same order
and then the Compare() checks if the lists are the same.
 
Bernd VanSkiver
[EMAIL PROTECTED]
801.520.5957
 
-Original Message-
From: Greg Luce [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 14, 2004 5:43 PM
To: CF-Talk
Subject: RE: Compare List
 
Brendan,
What would you use to for the sort order? These lists can be in
any order. Such as: 1,2,3,4,5 And 3,1,2,5,4
 
How would you compare these 2 lists using these functions?
 
Greg
 
-Original Message-
From: Brendan Avery [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 14, 2004 5:29 PM
To: CF-Talk
Subject: RE: Compare List
 
Compare(ListSort(list1,text),ListSort(list2,text)
 
Boo-yah.
 
== Brendan Avery -- http://www.brendanavery.com ==
 
-Original Message-
From: Greg Luce [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 14, 2004 1:40 PM
To: CF-Talk
Subject: RE: Compare List
 
You're looking for a match where both lists contain the 
 same values, but
possibly in different orders right? I would try:
 
cfset state_list = 1,2,3,4,5,6,7,8
cfset query_list = 9,8,7,6,5,4,3,2
 
cfif listlen(state_list) EQ listlen(query_list)
cfloop index=i list=#state_list#
 cfif NOT listcontains(query_list, i)
Not A Complete Matchcfabort
 /cfif
/cfloop
Lists Match
cfelse
Not Same Length Match
/cfif
 
Greg
 
-Original Message-
From: cfhelp [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 14, 2004 2:13 PM
To: CF-Talk
Subject: Compare List
 
Will Compare(String1,String2) work to compare a list?
 
I have a Comma Delimited list of GUIDS (up to 50 for each 
 state). That I
need to compare to a list GUIDS from a Query. If they match 
 then return
true (1). 
 
The GUIDS in the list may not be in the same order as the 
 GUIDS from the
query.
 
Any ideas?
 
Rick
 
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.583 / Virus Database: 369 - Release Date: 
 2/10/2004 
 

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Compare List

2004-03-15 Thread Tony Weeg
go to the bottom of any of these emails to unsubscribe 

-Original Message-
From: Tangorre, Michael [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 15, 2004 8:28 AM
To: CF-Talk
Subject: RE: Compare List

Go to the HOF site to unsubscribe.

 -Original Message-
 From: Christopher Farino [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 15, 2004 8:23 AM
 To: CF-Talk
 Subject: Re: Compare List
 
 unsubscribe
- Original Message -
From: Bernd VanSkiver
To: CF-Talk
Sent: Monday, March 15, 2004 1:03 AM
Subject: RE: Compare List
 
The ListSort() function sorts the lists and puts them in the same 
 order
and then the Compare() checks if the lists are the same.
 
Bernd VanSkiver
[EMAIL PROTECTED]
801.520.5957
 
-Original Message-
From: Greg Luce [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 14, 2004 5:43 PM
To: CF-Talk
Subject: RE: Compare List
 
Brendan,
What would you use to for the sort order? These lists can be in
any order. Such as: 1,2,3,4,5 And 3,1,2,5,4
 
How would you compare these 2 lists using these functions?
 
Greg
 
-Original Message-
From: Brendan Avery [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 14, 2004 5:29 PM
To: CF-Talk
Subject: RE: Compare List
 
Compare(ListSort(list1,text),ListSort(list2,text)
 
Boo-yah.
 
== Brendan Avery -- http://www.brendanavery.com ==
 
-Original Message-
From: Greg Luce [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 14, 2004 1:40 PM
To: CF-Talk
Subject: RE: Compare List
 
You're looking for a match where both lists contain the same values, 
 but
possibly in different orders right? I would try:
 
cfset state_list = 1,2,3,4,5,6,7,8
cfset query_list = 9,8,7,6,5,4,3,2
 
cfif listlen(state_list) EQ listlen(query_list)
cfloop index=i list=#state_list#
 cfif NOT listcontains(query_list, i)
Not A Complete Matchcfabort
 /cfif
/cfloop
Lists Match
cfelse
Not Same Length Match
/cfif
 
Greg
 
-Original Message-
From: cfhelp [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 14, 2004 2:13 PM
To: CF-Talk
Subject: Compare List
 
Will Compare(String1,String2) work to compare a list?
 
I have a Comma Delimited list of GUIDS (up to 50 for each state). 
 That I
need to compare to a list GUIDS from a Query. If they match then 
 return
true (1). 
 
The GUIDS in the list may not be in the same order as the GUIDS from 
 the
query.
 
Any ideas?
 
Rick
 
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.583 / Virus Database: 369 - Release Date: 
 2/10/2004
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Compare List

2004-03-14 Thread Dave Carabetta
 Will Compare(String1,String2) work to compare a list?

*Technically,* you could probably use compare() if you can guarantee the
order and casing of the elements in each list. But, I wouldn't rely on this.

 I have a Comma Delimited list of GUIDS (up to 50 for each state). That I
 need to compare to a list GUIDS from a Query. If they match then return
true
 (1).

 The GUIDS in the list may not be in the same order as the GUIDS from the
 query.


http://www.cflib.org/udf.cfm?ID=149

Regards,
Dave.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Compare List

2004-03-14 Thread Greg Luce
You're looking for a match where both lists contain the same values, but
possibly in different orders right? I would try:

cfset state_list = 1,2,3,4,5,6,7,8
cfset query_list = 9,8,7,6,5,4,3,2

cfif listlen(state_list) EQ listlen(query_list)
cfloop index=i list=#state_list#
 cfif NOT listcontains(query_list, i)
Not A Complete Matchcfabort
 /cfif
/cfloop
Lists Match
cfelse
Not Same Length Match
/cfif

Greg

-Original Message-
From: cfhelp [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 2:13 PM
To: CF-Talk
Subject: Compare List

Will Compare(String1,String2) work to compare a list?

I have a Comma Delimited list of GUIDS (up to 50 for each state). That I
need to compare to a list GUIDS from a Query. If they match then return
true (1). 

The GUIDS in the list may not be in the same order as the GUIDS from the
query.

Any ideas?

Rick

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.583 / Virus Database: 369 - Release Date: 2/10/2004
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Compare List

2004-03-14 Thread Brendan Avery
Compare(ListSort(list1,text),ListSort(list2,text)

Boo-yah.

== Brendan Avery -- http://www.brendanavery.com ==

-Original Message-
From: Greg Luce [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 1:40 PM
To: CF-Talk
Subject: RE: Compare List

You're looking for a match where both lists contain the same values, but
possibly in different orders right? I would try:

cfset state_list = 1,2,3,4,5,6,7,8
cfset query_list = 9,8,7,6,5,4,3,2

cfif listlen(state_list) EQ listlen(query_list)
cfloop index=i list=#state_list#
 cfif NOT listcontains(query_list, i)
Not A Complete Matchcfabort
 /cfif
/cfloop
Lists Match
cfelse
Not Same Length Match
/cfif

Greg

-Original Message-
From: cfhelp [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 2:13 PM
To: CF-Talk
Subject: Compare List

Will Compare(String1,String2) work to compare a list?

I have a Comma Delimited list of GUIDS (up to 50 for each state). That I
need to compare to a list GUIDS from a Query. If they match then return
true (1). 

The GUIDS in the list may not be in the same order as the GUIDS from the
query.

Any ideas?

Rick

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.583 / Virus Database: 369 - Release Date: 2/10/2004
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Compare List

2004-03-14 Thread Greg Luce
Brendan,
	What would you use to for the sort order? These lists can be in
any order. Such as:
1,2,3,4,5
And
3,1,2,5,4

How would you compare these 2 lists using these functions?

Greg

-Original Message-
From: Brendan Avery [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 5:29 PM
To: CF-Talk
Subject: RE: Compare List

Compare(ListSort(list1,text),ListSort(list2,text)

Boo-yah.

== Brendan Avery -- http://www.brendanavery.com ==

-Original Message-
From: Greg Luce [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 1:40 PM
To: CF-Talk
Subject: RE: Compare List

You're looking for a match where both lists contain the same values, but
possibly in different orders right? I would try:

cfset state_list = 1,2,3,4,5,6,7,8
cfset query_list = 9,8,7,6,5,4,3,2

cfif listlen(state_list) EQ listlen(query_list)
cfloop index=i list=#state_list#
 cfif NOT listcontains(query_list, i)
Not A Complete Matchcfabort
 /cfif
/cfloop
Lists Match
cfelse
Not Same Length Match
/cfif

Greg

-Original Message-
From: cfhelp [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 2:13 PM
To: CF-Talk
Subject: Compare List

Will Compare(String1,String2) work to compare a list?

I have a Comma Delimited list of GUIDS (up to 50 for each state). That I
need to compare to a list GUIDS from a Query. If they match then return
true (1). 

The GUIDS in the list may not be in the same order as the GUIDS from the
query.

Any ideas?

Rick

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.583 / Virus Database: 369 - Release Date: 2/10/2004
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Compare List

2004-03-14 Thread cfhelp
Worked Perfect!

 
Thanks 

 
Rick

 
-Original Message-
From: Greg Luce [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 1:40 PM
To: CF-Talk
Subject: RE: Compare List

 
You're looking for a match where both lists contain the same values, but
possibly in different orders right? I would try:

cfset state_list = 1,2,3,4,5,6,7,8
cfset query_list = 9,8,7,6,5,4,3,2

cfif listlen(state_list) EQ listlen(query_list)
cfloop index=i list=#state_list#
 cfif NOT listcontains(query_list, i)
Not A Complete Matchcfabort
 /cfif
/cfloop
Lists Match
cfelse
Not Same Length Match
/cfif

Greg

-Original Message-
From: cfhelp [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 2:13 PM
To: CF-Talk
Subject: Compare List

Will Compare(String1,String2) work to compare a list?

I have a Comma Delimited list of GUIDS (up to 50 for each state). That I
need to compare to a list GUIDS from a Query. If they match then return
true (1). 

The GUIDS in the list may not be in the same order as the GUIDS from the
query.

Any ideas?

Rick

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.583 / Virus Database: 369 - Release Date: 2/10/2004
_

[HYPERLINK http://www.houseoffusion.com/lists.cfm?link=t:4Todays Threads]
[HYPERLINK http://www.houseoffusion.com/lists.cfm?link=i:4:156447This
Message] [HYPERLINK
http://www.houseoffusion.com/lists.cfm?link=s:4Subscription] [HYPERLINK
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=984.904.4Fast
Unsubscribe] [HYPERLINK http://www.houseoffusion.com/signin/User Settings]

_

HYPERLINK http://www.houseoffusion.com/banners/view.cfm?bannerid=37 \n

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.583 / Virus Database: 369 - Release Date: 2/10/2004

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.583 / Virus Database: 369 - Release Date: 2/10/2004
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Compare List

2004-03-14 Thread Bernd VanSkiver
The ListSort() function sorts the lists and puts them in the same order
and then the Compare() checks if the lists are the same.

Bernd VanSkiver
[EMAIL PROTECTED]
801.520.5957

-Original Message-
From: Greg Luce [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 5:43 PM
To: CF-Talk
Subject: RE: Compare List

Brendan,
	What would you use to for the sort order? These lists can be in
any order. Such as: 1,2,3,4,5 And 3,1,2,5,4

How would you compare these 2 lists using these functions?

Greg

-Original Message-
From: Brendan Avery [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 5:29 PM
To: CF-Talk
Subject: RE: Compare List

Compare(ListSort(list1,text),ListSort(list2,text)

Boo-yah.

== Brendan Avery -- http://www.brendanavery.com ==

-Original Message-
From: Greg Luce [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 1:40 PM
To: CF-Talk
Subject: RE: Compare List

You're looking for a match where both lists contain the same values, but
possibly in different orders right? I would try:

cfset state_list = 1,2,3,4,5,6,7,8
cfset query_list = 9,8,7,6,5,4,3,2

cfif listlen(state_list) EQ listlen(query_list)
cfloop index=i list=#state_list#
 cfif NOT listcontains(query_list, i)
Not A Complete Matchcfabort
 /cfif
/cfloop
Lists Match
cfelse
Not Same Length Match
/cfif

Greg

-Original Message-
From: cfhelp [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 14, 2004 2:13 PM
To: CF-Talk
Subject: Compare List

Will Compare(String1,String2) work to compare a list?

I have a Comma Delimited list of GUIDS (up to 50 for each state). That I
need to compare to a list GUIDS from a Query. If they match then return
true (1). 

The GUIDS in the list may not be in the same order as the GUIDS from the
query.

Any ideas?

Rick

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.583 / Virus Database: 369 - Release Date: 2/10/2004
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Compare list vs. recordset?

2003-09-05 Thread Deanna Schneider
Is this for an update form with checkboxes? I usually handle this by
deleting the old entries and reinserting, rather than taking the time to
loop through and look for updates

-Deanna

- Original Message - 
From: Jeff Chastain [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Friday, September 05, 2003 11:26 AM
Subject: Compare list vs. recordset?


 I am looking for suggestions on the best way to go about this.

 I am receiving two comma separated lists from a form - one is a list of
 numerical object ids and the other is a corresponding list of numerical
 object classes (i.e. the first item in the object id list has a class
 corresponding to the first item in the object class list).

 I have a database table that contains two fields - objectID and
objectClass.
 Now, I need to compare the information in the database with the
information
 received in the two lists.  If an object is in the list and not in the
 database, then it needs to be added to the database.

 One other potential issue - there may be duplicate object ids in the
object
 id list - the combination of the object id and object class makes each
entry
 unique.

 Anybody have any suggestions on the best method to compare these two
 structures?

 Example -
   ObjectID List = 1,2,3,3,1,4,5
   ObjectClass List = 1,1,1,2,2,1,2

   Recordset (objectid, objectclass)
 (1,1), (2,1), (1,2), (4,1)

   so ... the objectID, objectClass pair 3,1 and 5,2 would need to be added
 to the database.

 Thanks for any suggestions.
 -- Jeff


 
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com


RE: Compare list vs. recordset?

2003-09-05 Thread Jeff Chastain
Yes, it is an update form with checkboxes.  The reason I cannot delete
everything and reinsert it (beyond the fact that this sounds very hard on
the database) is that other data is stored in the database for each record
which I cannot duplicate.  Therefore, I really need to be to utilize the
existing records and just add new ones as necessary.

Thanks
-- Jeff


-Original Message-
From: Deanna Schneider [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 05, 2003 12:15 PM
To: CF-Talk
Subject: Re: Compare list vs. recordset?


Is this for an update form with checkboxes? I usually handle this by
deleting the old entries and reinserting, rather than taking the time to
loop through and look for updates

-Deanna

- Original Message - 
From: Jeff Chastain [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Friday, September 05, 2003 11:26 AM
Subject: Compare list vs. recordset?


 I am looking for suggestions on the best way to go about this.

 I am receiving two comma separated lists from a form - one is a list of
 numerical object ids and the other is a corresponding list of numerical
 object classes (i.e. the first item in the object id list has a class
 corresponding to the first item in the object class list).

 I have a database table that contains two fields - objectID and
objectClass.
 Now, I need to compare the information in the database with the
information
 received in the two lists.  If an object is in the list and not in the
 database, then it needs to be added to the database.

 One other potential issue - there may be duplicate object ids in the
object
 id list - the combination of the object id and object class makes each
entry
 unique.

 Anybody have any suggestions on the best method to compare these two
 structures?

 Example -
   ObjectID List = 1,2,3,3,1,4,5
   ObjectClass List = 1,1,1,2,2,1,2

   Recordset (objectid, objectclass)
 (1,1), (2,1), (1,2), (4,1)

   so ... the objectID, objectClass pair 3,1 and 5,2 would need to be added
 to the database.

 Thanks for any suggestions.
 -- Jeff


 

~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm