Re: Eliminating duplicate items from a list
Re: Eliminating duplicate items from a list
- Subject: Re: Eliminating duplicate items from a list
- From: Luther Fuller <email@hidden>
- Date: Tue, 4 Sep 2007 19:43:16 -0500
On Sep 3, 2007, at 9:31 PM, Brett Conlon wrote:
In Lotus Programming I can wrap a list in an @Unique(List variable)
command and it strips out all duplicate items. What is the simplest
way to do it in AS?
I'm thinking it may have to be with a repeat and using text item
delimiters, right?
So, I'm sitting here with nothing else to do but be curious, so I
tried ...
on uniqueList(originalList)
set newList to {}
repeat until originalList = {}
set firstItem to (first item of originalList)
set originalList to (rest of originalList)
if firstItem is not in originalList then set newList to newList &
{firstItem}
end repeat
return newList
end uniqueList
Seems to work correctly. But is it fast? er?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden