by Raghuraja. C (21 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 17th February 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Function to Get the File name only where File name with Folder name is passed
' To get file name from file object
On Error GoTo LOCALERRORHANDLER
Dim intInc As Integer 'For incremental value
Dim intPos As Integer 'For storing position
For intInc = 1 To Len(strFileName)
If MID(strFileName, intInc, 1) = "\" Then
intPos = intInc
End If
Next
fnGetFileName = MID(strFileName, intPos + 1)
Exit Function
LOCALERRORHANDLER:
fnGetFileName = ""
End Function
No comments have been posted about Function to Get the File name only where File name with Folder name is passed. Why not be the first to post a comment about Function to Get the File name only where File name with Folder name is passed.