Signature (Visual Basic / VBA)
Public Function PathAndNamesStringToVariantVector( _
ByRef rFiles() As Variant _
, ByVal vList As Variant _
) As Boolean
Code Examples
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"
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"
Parameters
| Parameter | Description |
|---|---|
| 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.
Notes & Version History
| 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. |
| Warning | This function cannot currently handle quoted-file names nor ones that contain embedded spaces. |