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

Combine Path And File Function
File Names Class

Public Function CombinePathAndFile( _
      ByVal vPath As Variant _
    , ByVal vFile As Variant _
    ) As Variant

Combine a path name with a file name, inserting the appropriate separator.

Examples:
    CombinePathAndFile("",    "WINDOWS")  = "WINDOWS"
    CombinePathAndFile("C",   "WINDOWS")  = "C\WINDOWS" ' #2
    CombinePathAndFile("C",   "\WINDOWS") = "C\WINDOWS" ' #3
    CombinePathAndFile("C:",  "WINDOWS")  = "C:WINDOWS"
    CombinePathAndFile("C:",  "\WINDOWS") = "C:\WINDOWS"
    CombinePathAndFile("C:\", "WINDOWS")  = "C:\WINDOWS"
    CombinePathAndFile("C:\", "\WINDOWS") = "C:\WINDOWS"
    CombinePathAndFile("\\SJS4\C",  "")          = "\\SJS4\C"
    CombinePathAndFile("\\SJS4\C",  "ENTISOFT")  = "\\SJS4\C\ENTISOFT"
    CombinePathAndFile("\\SJS4\C",  "\ENTISOFT") = "\\SJS4\C\ENTISOFT"
    CombinePathAndFile("\\SJS4\C\", "ENTISOFT")  = "\\SJS4\C\ENTISOFT"
    CombinePathAndFile("\\SJS4\C\", "\ENTISOFT") = "\\SJS4\C\ENTISOFT"
See also:
    CombineDriveAndPath Function
    CombinePrefixAndExtension Function
    SeparatePathAndFile Function
vPath: The drive and/or directory path portions of a file name. Function returns Null if vPath is Null or cannot be fixed-up to a string.
vFile: The file prefix and/or extension portions of a file name. Function returns Null if vFile is Null or cannot be fixed-up to a string.
Note: Similar to the CombineDriveAndPath function except in cases where the first argument is a single letter as in examples #2 and #3.

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