<-- Previous || Up || Next -->

Unique Path Names Variant Vector Function
File Names Class

Public Function UniquePathNamesVariantVector( _
      ByRef rPaths() As Variant _
    , ByRef vPaths() As Variant _
    , Optional ByVal vCompare As Variant _
    ) As Boolean

Function converts the path names in an array to absolute path names them removes the duplicates.
Function returns True upon success and False upon failure.

       CurDir$ = "C:\Windows"
       Dim avarIn() As Variant
       ReDim avarIn(0 to 3)
       avarIn(1) = "C:\Temp"
       avarIn(2) = "System"  ' Relative to CurDir$
       avarIn(3) = "..\Temp" ' Same as avarIn(1)
       Dim avarOut() As Variant
    for example
       UniquePathNamesVariantVector(avarOut(), avarIn()) = True
       LBound(avarOut) = 0
       UBound(avarOut) = 2
       IsEmpty(avarOut(0)) = True
       avarOut(1) = "C:\Temp"
       avarOut(2) = "C:\Windows\System"
See also:
    MakePathAbsolute Function
    UniqueVariantVector Function
    MakeDirectory Function
    DirToVariantVector Function
rPaths: Dynamic, one-dimensional array of Variants that will receive the unique, absolute path names. rPaths will be re-dimensioned from 0 (zero) to the upper bound of vPaths, and the path names are placed in elements 1 (one) through the upper bound.
vPaths: One-dimensional array of Variants that contains the path names to be processed. Function examines elements 1 (one) through the upper bound of vPaths.
vCompare: Type of string comparisons used to determine if absolute path names match. vCompare defaults to Text Comparisons (vbTextCompare) if it is missing or Null or cannot be fixed-up to a number.
v1.1 Change: Function renamed from UniqueDirectoryVariantVector to UniquePathNamesVariantVector. Argument names were changed and the vCompare argument was added.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.