Sub File Names Class

SeparatePathAndFileSample

Signature (Visual Basic / VBA)

Private Sub SeparatePathAndFileSample()
    ' Print some samples of the SeparatePathAndFile function.

    Dim strTest As String

    strTest = "C:\WIN.INI":     GoSub One_SeparatePathAndFileSample
    strTest = "C:WIN.INI":      GoSub One_SeparatePathAndFileSample
    strTest = "WIN.INI":        GoSub One_SeparatePathAndFileSample
    strTest = "C:":             GoSub One_SeparatePathAndFileSample
    strTest = "C:WIN\WIN.INI":  GoSub One_SeparatePathAndFileSample

    Exit Sub

One_SeparatePathAndFileSample:

    Dim strPath As String
    Dim strFile As String

    Debug.Print
    Debug.Print "Return = " & SeparatePathAndFile(strPath, strFile, strTest)
    Debug.Print "strTest: " & strTest
    Debug.Print "strPath: " & strPath
    Debug.Print "strFile: " & strFile

    Return
End Sub