Re: Duplicates List from Sequence
- Posted by Lionel Wong <eljay98 at HOTMAIL.COM> Jan 06, 2000
- 543 views
Here's an easy function to remove dupe elements from a sequence, which I knew for a long time and have kept it to myself until now: function del_dupes( sequence in ) sequence out out = {} for i = 1 to length( in ) do if not find( in[i], out ) then out = append( out, in[i] ) end if end for return out end function To list out ONLY duplicates, it merely requires some modification: function list_dupes( sequence in ) sequence out, check out = {} check = {} for i = 1 to length( in ) do check = append( check, in[in] ) if find( in[i], check ) then out = append( out, in[i] ) end if end for return out end function Be warned that list_dupes() was cooked up without being tested. Hope this helps! Lionel ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com