Advertisement
4_2005-2006 Files/ File Controls/ Input/ Output #152781

Filename only from a path

Ever wanted to extract a filename only from a path including the filename, well this simple function will do it for you! (I know its not ground breaking but its simple easy and useful)

AI

Tóm tắt bởi AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Mã nguồn
original-source
Function get_filename_only(filepath)
For x = Len(filepath) To 1 Step -1
  If Mid(filepath, x, 1) = "\" Then
    get_filename_only = Right(filepath, Len(filepath) - x)
    Exit Function
  End If
Next x
get_filename_only = "Please check filepath it may be incorrect)"
End Function
Upload
Bình luận gốc (3)
Được khôi phục từ Wayback Machine