FileRoot

Returns root of filename.

Syntax:

FileRoot (filename)

Parameters:

(s) filename [optional path] full file name, including extension.

Returns:

(s) file root.

 

FileRoot parses the passed filename and returns the root part of the filename. The root part of the filename is the portion of the filename before the dot extension.

TEST.TXT ; TEST is the root of the filename.

Example:


allfiles = FileItemize("*.*")
editfile = AskItemlist("Select file to edit", allfiles,@TAB, @UNSORTED, @SINGLE, @FALSE)
root = FileRoot(editfile)
ext = FileExtension(editfile)
lowerext = StrLower(ext)
nicefile = StrCat(root, ".", lowerext)
Message("", "You are about to edit %nicefile%.")
DirChange(DirWindows(0))
Run("notepad.exe", editfile)
See Also:

FileExtension, FilePath, FileBaseName