DADiSP Worksheet Functions > Function Categories > File Manipulation > DIRPATH
Returns the directory component of a path string.
DIRPATH("path", labflag)
(pathname, filename) = DIRPATH("path", labflag)
"path" |
- |
Optional. A string, a full path string containing a directory component. |
||||
labflag |
- |
Optional. An integer, append Labbook path if no path found:
|
A string, the directory name.
(pathname, filename) = DIRPATH("path") returns the path component and filename component in two separate variables.
dirpath("\dsp\system.mac")
returns the directory component "dsp"
(p, n) = dirpath("\dsp\system.mac")
p == "\dsp\"
n == "system.mac"
DIRPATH is used internally to retrieve the last directory in file dialog boxes - see system.mac.
If the path string does not contain a directory component, by default, the current LABBOOK path is returned.
See FILEPARTS for a generic function to obtain file name components
SYSTEM.MAC