VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This code gets the file name from a given path.

by Darkhacka (3 Submissions)
Category: String Manipulation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sat 27th January 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This code gets the file name from a given path.

API Declarations



No declarations required for this code.

Rate This code gets the file name from a given path.



'This function gets the filename from a path
'PathString must include the filename in the whole path.
'Usage: StringName = NameFromPath(PathString)
Dim X As Integer, Ps As Integer, Tmp As String
Tmp = FilePath
For X = 1 To Len(Tmp)
Ps = InStr(1, Tmp, "\", vbTextCompare)
    If Ps <> 0 Then
        Tmp = Mid(Tmp, Ps + 1)
    Else
    End If
Next X
NameFromPath = Tmp
End Function


Download this snippet    Add to My Saved Code

This code gets the file name from a given path. Comments

No comments have been posted about This code gets the file name from a given path.. Why not be the first to post a comment about This code gets the file name from a given path..

Post your comment

Subject:
Message:
0/1000 characters