VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



An function to extract a filename from an path & filename

by Bernt Figaro (8 Submissions)
Category: Files/File Controls/Input/Output
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Fri 6th October 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

An function to extract a filename from an path & filename

API Declarations


Similar to VB6 reverse function.

Rate An function to extract a filename from an path & filename



DefInt A-Z
Function Backwards$(Inline As String)
Rem
Rem  -------------------------------------------------------
Rem  Purpose: Extract a filename from a full path & filename
Rem  -------------------------------------------------------
Rem 2000-06-09
Rem [email protected]
Rem

Dim D As String
Dim I As Integer
If Inline = "" Then Exit Function
GoSub Reverse
GoSub Reverse
Backwards$ = Inline
Exit Function
Reverse:
D = ""
For I = Len(Inline) To 1 Step -1
If Mid$(Inline, I, 1) = "\" Then Exit For
D = D + Mid$(Inline, I, 1)
Next I
Inline = D
Return

 
End Function



Download this snippet    Add to My Saved Code

An function to extract a filename from an path & filename Comments

No comments have been posted about An function to extract a filename from an path & filename. Why not be the first to post a comment about An function to extract a filename from an path & filename.

Post your comment

Subject:
Message:
0/1000 characters