Code
Public Function SArr_PurgeDups(SArray() As String, CaseSen As Boolean) As String()
'Function
'   Removes all duplicate elements from a String Array and returns the result.
'   If the specified Array is Empty, returns an Empty Array.
'Parameters
'   SArray (String()) = The String Array to make unique.
'   CaseSen (Boolean) = If True, the comparison is case-sensitive.
'       If False, the comparison is not case-sensitive.
'       In this case, if MyString is found in SArray without regard to case, function returns True.
'Version History
'   1.0 4/1/2006 7:39am Tested by Russ Tanner on VB6 Win2000
'---

'Initiate variables
Dim R() As String       'return value
Dim i As Long           'loop counter

'Trap: Specified Array is Empty, return an Empty Array
If IsEmptyArray(SArray) Then
    SArr_PurgeDups = R
    Exit Function
End If

'Loop through all elements of the specified array and add non-duplicates to the return buffer...
For i = LBound(SArray) To UBound(SArray)
    'The current source element is not in the output Array, add it now
    If Not SArray_StrExists(R, SArray(i), CaseSen) Then
        ReDim Preserve R(ElementCount(R))
        R(UBound(R)) = SArray(i)
    End If
Next i

'Return the result
SArr_PurgeDups = R

End Function


The Captian
Today they call you "crazy". Tomorrow they call you "ahead of your time."
Global Skywatch Learn about Chemtrails - You're breathing them now!
OnlyTheBestHerbs.com World-class supplements
Mercury Talk Why you are sick.
OneUp Domains Domains, Hosting, Email
1-800-358-4278 (U.S. & Canada)