Wait... I cant remember if I wrote those or not. I have a library of list
functions... Some I wrote, some I got offa CFlib. Don;t want to take credit
for someone else's work.
G
On Tue, May 13, 2008 at 12:04 PM, Gerald Guido <[EMAIL PROTECTED]>
wrote:
> You can do it using a QoQ and Select DISTINCT
>
> OR
>
> I wrote a couple of functions to do this. One day I will post them to
> CFLib.....
>
> /**
> * Case-sensitive function for removing duplicate entries in a list.
> * @param list The list to be modified.
> * @return Returns a list.
> */
> function ListDeleteDuplicates(list) {
> var i = 1;
> var delimiter = ',';
> var returnValue = '';
> if(ArrayLen(arguments) GTE 2)
> delimiter = arguments[2];
> list = ListToArray(list, delimiter);
> for(i = 1; i LTE ArrayLen(list); i = i + 1)
> if(NOT ListFind(returnValue, list[i], delimiter))
> returnValue = ListAppend(returnValue, list[i], delimiter);
>
> return returnValue;
> }
>
>
> /**
> * Case-INsensitive function for removing duplicate entries in a list.
> * @param list List to be modified.
> * @return Returns a list.
> */
> function ListDeleteDuplicatesNoCase(list)
> {
> var i = 1;
> var delimiter = ',';
> var returnValue = '';
> if(ArrayLen(arguments) GTE 2)
> delimiter = arguments[2];
> list = ListToArray(list, delimiter);
> for(i = 1; i LTE ArrayLen(list); i = i + 1)
> if(NOT ListFindNoCase(returnValue, list[i], delimiter))
> returnValue = ListAppend(returnValue, list[i], delimiter);
> return returnValue;
>
> }
>
>
> On Tue, May 13, 2008 at 11:46 AM, morchella <[EMAIL PROTECTED]>
> wrote:
>
> > awsome...
> > thank you!
> >
> > now.. =]
> > how would i remove doubles?
> >
> > <!--- List of Accessory's that are assigned to this product --->
> > <cfquery name="getAccessory" datasource="listit">
> > SELECT DISTINCT ascList
> > FROM dbo.list
> > WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL)
> > </cfquery>
> >
> > gives me...
> >
> > ascList
> > 132
> > 135
> > 135,132
> >
> > so my list looks like
> > aclist: 132,135,135,132
> >
> > just want 132,135
> >
> > thanks again!
> >
> >
> >
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305174
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4