if you want to do this through the database backend simply add a new column to the table and assign a unique id, then find the row you want and delete it where the unique id = x ----- Original Message ----- From: "Keith Gaughan" <[EMAIL PROTECTED]> To: "CF-Talk" <[email protected]> Sent: Wednesday, April 20, 2005 6:20 AM Subject: Re: take duplicate out of a list
> CFDEV wrote: > > > Hi, is there an easy way to take duplicate out of a list or do I have to > > loop trough the list and create a new list with all elements and check if > > they are already in the new list before inserting them? > > Here's a neat method: > > <cfset lst = "a,list,with,with,duplicate,elements"> > <!--- We shall be using a struct as a set! ---> > <cfset set = StructNew()> > <cfloop index="elem" list="#lst#"> > <cfset set[elem] = ""> > </cfloop> > <cfset lst = StructKeyList(set)> > > Et, voil�! > > After all, a map is just a set with values attached to each one of the > elements. For example, the HashSet in Java is internally implemented > using a HashMap. > > K. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:203620 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

