Displaying Source Code(s)
|
|
RemDups Function - Remove Duplicate values from an array
--------------------------------------------------------------------------------
Description : RemDups removes duplicates from an array and
returns a new array with no duplicates. Does not modify the
existing array.
<%
Function RemDups(ByVal anArray)
Dim d, item, thekeys
Set d = CreateObject("Scripting.Dictionary")
d.removeall
d.CompareMode = 0
For Each item In anArray
If Not d.Exists(item) Then d.Add item, item
Next
thekeys = d.keys
Set d = Nothing
RemDups = thekeys
End Function
%> |
|
|