--openmail-part-0a1570ef-00000001
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Content-Disposition: inline

> Is there an easy way to take the elements of one list and remove them
from
> another list? i.e. Subtract ListB from ListA to get ListC

------------------------------------------------
<cfset BigList = "1,2,3,4,5,6">
<cfset SubList = "2,4,6">

<cfparam name="NewList" default="">

<cfloop list="#BigList#" index="BigListItem">
      <cfif NOT ListContains(SubList,BigListItem)>
            <cfset NewList = ListAppend(NewList,BigListItem)>           
      </cfif>
</cfloop>
------------------------------------------------

Give that a shot.

Andrew Kneisler
Cold Fusion Development, BNMD/ODS
913-315-6583
[EMAIL PROTECTED]


-----Original Message-----
From: spark [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 30, 2000 5:59 PM
To: cf-talk
Cc: spark
Subject: subtract elements of one list from another?


Is there an easy way to take the elements of one list and remove them
from
another list? i.e. Subtract ListB from ListA to get ListC

ListA = (1,2,3,4,5,6)
ListB = (2,4,6)

I want returned ListC = (1,3,5)

Thanks! 

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Simon Park        Computer Systems Management, Inc.
[EMAIL PROTECTED]    205 South Whiting Street
Ph: 703-823-4300  Suite 201
fax: 703-823-4301 Alexandria, VA  22304
             http://www.csmi.com  
------------------------------------------------------------------------
------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.


--openmail-part-0a1570ef-00000001--

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to