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

Path And Names String To Variant Vector Function
File Names Class

Public Function PathAndNamesStringToVariantVector( _
      ByRef rFiles() As Variant _
    , ByVal vList As Variant _
    ) As Boolean

Converts a string containing either 1) a file name or 2) a directory name and list of file names into a Variant array of path names.
This function "normalizes" the result string from the Windows Open File Dialog Box.

Example #1:
    Assuming
       Dim avarFiles() As Variant
    for example
       PathAndNamesStringToVariantVector(avarFiles(), "C:\WINDOWS\WIN.INI") = True
    leaves
       LBound(avarFiles) = 0
       UBound(avarFiles) = 1
       IsEmpty(avarFiles(0)) = True
       avarFiles(1) = "C:\WINDOWS\WIN.INI"
Example #2:
    Assuming
       Dim avarFiles() As Variant
       Dim strList As String
       strList = "C:\WINDOWS WIN.INI SYSTEM.INI C:\AUTOEXEC.BAT"
    for example
       PathAndNamesStringToVariantVector(avarFiles(), strList) = True
    leaves
       LBound(avarFiles) = 0
       UBound(avarFiles) = 3
       IsEmpty(avarFiles(0)) = True
       avarFiles(1) = "C:\WINDOWS\WIN.INI"
       avarFiles(2) = "C:\WINDOWS\SYSTEM.INI"
       avarFiles(3) = "C:\AUTOEXEC.BAT"
See also:
    DirToVariantVector Function
    Windows Common Dialog Boxes (Windows API)
rPathName: Dynamic, one-dimensional array of Variants that will receive the file name(s) from this function. rPathName will be re-dimensioned from 0 (zero) to the number of files found, and the file names are placed in elements 1 (one) through the number found. rPathNames will be re-dimensioned even if the function encounters an error and returns False.
vList: String containing either 1) a file name, or 2) a directory name and a list of file names relative to the directory name. In case #2, the directory name and file names must be separated by the space character. Function returns False if vList is Null or cannot be fixed-up to a string.
Return value: Function returns True upon success and False upon failure.
Warning: This function cannot currently handle quoted-file names nor ones that contain embedded spaces.

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