At 12:40 PM 7/28/2003 -0400, you wrote:
>How would I make one list that combines the elements of list1 that changed 
>in list2? For example
>List1: State:FL, City:Jax, County:Duval, Zip:32246
>List2: State:FL, City:Jax, County:St Johns, Zip:32259
>
>Output: County:Duval changed to County:St Johns, Zip:32246 changed to 
>Zip:32259

Will your two lists always consist of those same fields? State, City, 
County, Zip? If so, that'll make it easier...

First, create a variable to hold your output comments, just a blank var.

Do a loop from 1 to the length of either of those lists (i.e. 
ListLen(List1)). Since those lists are comma delimited, that'll be fine. 
Let's say you use the index var 'pos' on this loop.

Then compare ListLast(ListGetAt(List1, pos), ":") to 
ListLast(ListGetAt(List2, pos), ":"). Note we're using : as a delimeter for 
these mini-lists.

If the two values different, then use ListAppend to append to your output 
variable list:

ListGetAt(List1, pos) & " changed to " & ListGetAt(List2, pos)

That should do it.
--Scott

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Get the mailserver that powers this list at 
http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to