Next: addmacrofile() Up: MacAnova Help File Previous: addlines()   Contents

adddatapath()

Usage:
adddatapath(dirName [,T]), dirName a quoted string or CHARACTER vector
  specifying one or more additional directory or folder names to search
  when attempting to read a file



Keywords: input, files
adddatapath(DirName) adds DirName at the beginning of CHARACTER vector
DATAPATHS.  DirName must be a quoted string or CHARACTER scalar
specifying the name of a directory or folder.  See topic 'DATAPATHS'.

When commands such as matread(), macroread() and vecread() don't find a
wanted file in the default directory (see 'files'), they search for it
in the folders or directories whose names are in DATAPATHS.  Because
DirName is added at the start of DATAPATHS, the folder or directory will
be searched before any other locations in DATAPATHS.

adddatapath(DirName,T) does the same except DirName is added at the end
of DATAPATHS so the directory or folder will be searched last.

For both usages, DirName can also be a CHARACTER vector, each element of
which specifies a directory or folder to be searched.

When DATAPATHS does not already exist, adddatapath(DirName) creates it.

Example:
  Cmd> adddatapath("MyDisk:Survey Folder:") # on Macintosh

  Cmd> adddatapath("D:/SURVEY.DIR/") # on DOS/Windows

  Cmd> adddatapath("~/survey.dir") # on Linux/Unix

  Cmd> adddatapath(getfilename(pathonly:T)) # Windowed versions only

The last example adds to DATAPATHS the folder or directory containing
the file selected in a file navigation dialog box.

See also topics matread(), vecread(), macroread(), inforead(),
getfilename(), 'files'.


Gary Oehlert 2003-01-15