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

Separate Drive And Path Function
File Names Class

Public Function SeparateDriveAndPath( _
      ByRef rDrive As Variant _
    , ByRef rPath As Variant _
    , ByVal vPath As Variant _
    ) As Boolean

Separate a path name like "C:\WINDOWS\USER.EXE" into its Drive ("C:") and Path ("\WINDOWS\USER.EXE") components.
Function returns True upon success and False upon failure.

Summary:
    vPath                  rDrive           rPath
    ---------------------  ---------------  -------------
    C:\                    C:               \
    C:\Temp                C:               \Temp
    C:\Temp\Win.Tmp        C:               \Temp\Win.Tmp
    \\SJS4\C\Temp\Win.Tmp  \\SJS4\C         \Temp\Win.Tmp
    \\SJS4\Entisoft        \\SJS4\Entisoft
    \\SJS4\Entisoft\       \\SJS4\Entisoft  \
    \\SJS4\Entisoft\Tools  \\SJS4\Entisoft  \Tools
Example:
    Assuming
       Dim strDrive As String
       Dim strPath As String
    for example
       SeparateDriveAndPath(strDrive, strPath, "\\SJS4\Entisoft\Tools") = True
    leaves
       strDrive = "\\SJS4\Entisoft"
       strPath = "\Tools"
See also:
    SeparatePathAndFile Function
    SeparatePrefixAndExtension Function
    CombineDriveAndPath Function
rDrive: String or Variant that will receive the drive portion of vPath.
rPath: String or Variant that will receive the path and file name portion of vPath.
vPath: The path name that will be separated into its drive and directory/file name portions. If vPath is Null or cannot be fixed-up to a string, this function sets both rDrive and rPath to an empty string then returns False.

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