FileBaseName

Extracts the base filename from a full file path.

Syntax:

FileBaseName (filename [, flag])

Parameters:

(s) filename fully qualified file name.

(i) flag [optional] 0, or 1. See below.

Returns:

(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 ).

Examples:

allfiles = FileItemPath("*.*")
file = AskItemlist("Get base filename of…", allfiles, @TAB, @UNSORTED, @SINGLE, @FALSE)
basename = FileBaseName(file,0)
Message("Base Filename",basename)

 

See Also:

FileRoot, FileExtension, FileFullname