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.
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