back to Table of Contents


FileNamePart$ (function)

This simple function will return the name part of the given file or folder name. That is the part left of the rightmost found dot (if any). The dot itself is not included in the result, as it belongs to the name extension, which you can get using the function FileExtension$() instead.


SYNTAX:

name$ = FileNamePart$ (file$)

INPUTS:

file$ (STRING)


RESULT:

name$ (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