Extracts the base filename from a full file path.
FileBaseName (filename [, flag])
(s) filename fully qualified file name.
(i) flag [optional] 0, or 1. See below.
(i) base filename.
The optional 'flag' can be one of the following values"
Value |
Meaning |
0 |
(default) do not include a dot '.' on the end of a filename with no extension. |
1 |
include a dot '.' on the end of a filename with no extension. |
The base filename includes both the file root ( FileRoot ) and the file extension ( FileExtension ).
allfiles = FileItemPath("*.*") file = AskItemlist("Get base filename of ", allfiles, @TAB, @UNSORTED, @SINGLE, @FALSE) basename = FileBaseName(file,0) Message("Base Filename",basename)