Hi LiangTyan, just to demonstrate that the new "split"(I like them) can do in case of duplicate removing. for example you have a field/variable having something like "nameA,firstnameB" & cr & "nameA,firstnameC" in it, you can use "split" handler to select names witout duplicates.
get "nameA,firstnameB" & cr & "nameA,firstnameC" split it by return and comma get the keys of it -- in it you have "nameA" only one time regards eugen LiangTyan Fui wrote: > > Here is a function that I've written quite some time ago. It takes a list of > text theList, separated by theitemDel, remove duplicate items in the list, > and returns a new list without duplicate items. > Unfortunately, this function running rather slowly on a large list (a few > thousands records) - that is why I am posting here as a little "open > source", Request For Comment: Make it faster guys! > Remember, the sequence of the records cannot be changed, that say you are > not likely to use sort. > > Regards, > LiangTyan Fui > > ##### > > function stripDup theList,theitemDel > # verify param > if theList= "" then return "" > if theitemDel = "" then put cr into theitemDel > > # > set theitemDel to char 1 of theitemDel > > put number of items of theList into theListItem > put 1 into k > repeat > put item k of theList into key1 > repeat with c = theListItem down to k+1 > if key1 = item c of theList then > delete item c of theList > subtract 1 from theListItem > end if > end repeat > if k >= theListItem then exit repeat > add 1 to k > end repeat > return theList > end stripDup > > Archives: http://www.mail-archive.com/[email protected]/ > Info: http://www.xworlds.com/metacard/mailinglist.htm > Please send bug reports to <[EMAIL PROTECTED]>, not this list. -- Eugen Helbling _____________________________________________________________________ GINIT Technology GmbH [EMAIL PROTECTED] Eugen Helbling www.ginit-technology.com Emmy-Noether-Str. 11 phone: +49-721-96681-0 D-76131 Karlsruhe fax: +49-721-96681-111 Archives: http://www.mail-archive.com/[email protected]/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to <[EMAIL PROTECTED]>, not this list.
