VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



How to extract a file name from one path.

by Iratxe Bajo Urcelay (3 Submissions)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 20th November 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

How to extract a file name from one path.

API Declarations


Dim i As Integer

Rate How to extract a file name from one path.



commonDialog1.ShowOpen
nameFile = Mid$(commonDialog1.FileName, 4) 'removes "C:\"
Do
    If InStr(1, nameFile, "\") Then 'verifies if there is any "\"
    'Yes. It does exist "\"
        i = InStr(1, nameFile, "\")
        nameFile = Mid$(nameFile, i + 1)
    End If
Loop Until InStr(1, nameFile, "\") = False

Download this snippet    Add to My Saved Code

How to extract a file name from one path. Comments

No comments have been posted about How to extract a file name from one path.. Why not be the first to post a comment about How to extract a file name from one path..

Post your comment

Subject:
Message:
0/1000 characters