Purpose |
Parse a path/file name to extract component parts |
Syntax |
fil$
= PATHNAME$(director, filespec$) |
Remarks |
The PATHNAME$ function evaluates a path/file text
name, and returns a requested part of the name. The
functionality is strictly one of
string parsing
alone. No
attempt is made to find the file on disk. If you wish to scan for a particular
file on disk, you should use the companion function PATHSCAN$. |
director |
This is one of the following words which is used to specify the requested
part:
FULL |
Return the full path/file
name, just as given in the filespec$
parameter. This
is really a non-operation, but is included for symmetry with the companion
function PATHSCAN$. |
PATH |
Return the path portion
of the path/file name. That
is the text up to and
including the last backslash (\). |
NAME |
Return the name portion
of the path/file name. That
is the text to the
right of the last backslash (\), ending just before the last period (.). |
EXTN |
Return the extension portion
of the path/file name. That
is the last period
(.) in the string plus the text to the right of it. |
NAMEX |
Return the NAME and the
EXTN parts combined. |
|
filespec$ |
A path/file name which does not necessarily exist on disk. |
See also |
DIR$, PATHSCAN$,
PARSE, PARSE$,
PARSECOUNT |
Example |
PATHNAME$(PATH, "C:\PB\XXX.TXT")
' returns "C:\PB\"
PATHNAME$(NAME, "C:\PB\XXX.TXT") ' returns
"XXX.TXT"
PATHNAME$(EXTN, "C:\PB\XXX.TXT") ' returns
".TXT" |