VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Parse out the filepath and filename of a string and have each returned in separate variables passed

by Kelly Ethridge (3 Submissions)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 20th December 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Parse out the filepath and filename of a string and have each returned in separate variables passed in during the function call. This modifies

Rate Parse out the filepath and filename of a string and have each returned in separate variables passed



   Dim i As Long
   
   i = Len(FilePathAndName)
   Do While Mid$(FilePathAndName, i, 1) = "\"
      i = i - 1
   Loop
   If i = Len(FilePathAndName) Then
      FileName = Mid$(FilePathAndName, InStrRev(FilePathAndName, "\") + 1)
   Else
      i = i + 1
   End If
   FilePath = Left$(FilePathAndName, InStrRev(FilePathAndName, "\", i))
   
End Sub

Download this snippet    Add to My Saved Code

Parse out the filepath and filename of a string and have each returned in separate variables passed Comments

No comments have been posted about Parse out the filepath and filename of a string and have each returned in separate variables passed. Why not be the first to post a comment about Parse out the filepath and filename of a string and have each returned in separate variables passed.

Post your comment

Subject:
Message:
0/1000 characters