back to Table of Contents


FilePart$ (function)

This simple function will return the file part of the given file or folder specification. That is just the final name component after the rightmost backslash, which is usually the actual file or folder name without the path. To get the path, you would use the function PathPart$() instead.


SYNTAX:

file$ = FilePart$ (fileSpec$)

INPUTS:

fileSpec$ (STRING)


RESULT:

file$ (STRING)

While the first case (identical or not) is ok, you should explicitly check for the second case (empty) if required, as it may cause errors when trying to OPEN, MKDIR, CHDIR etc. with an empty name.

back to Table of Contents