MAINSAIL Language Manual, Section 32.79

previous   next   top   contents   index   framed top   this page unframed


32.79. $currentDirectory

Figure 32–78. $currentDirectory (GENERIC)
STRING
PROCEDURE   $currentDirectory
                        (
OPTIONAL BITS ctrlBits;
                         
PRODUCES OPTIONAL STRING msg);

STRING
PROCEDURE   $currentDirectory
                        (
STRING devModName;
                         
OPTIONAL BITS ctrlBits;
                         
PRODUCES OPTIONAL STRING msg);

If the operating system has a notion of a current working or connected file directory, folder, or catalog, the first instance of this PROCEDURE returns its name. If there is no such notion, or if it is not possible to determine the current working directory from a program, "" is returned. Consult the appropriate operating-system-specific MAINSAIL user's guide for details. If an error occurs, msg is set to a STRING describing the error, and if errorOK is not set in ctrlBits, an error message is issued. errorOK is the only valid bit in ctrlBits.

The devModName instance of $currentDirectory accepts a STRING as its first argument, which is a device prefix. $currentDirectory returns the name of the current directory for the specified device; if devModName is the empty STRING, this instance of $currentDirectory returns the same value as the first instance. devModName should be a device prefix followed by the STRING $devModBrkStr; i.e., to get the directory for a device D on a system where $devModBrkStr is ">", use the STRING "D>".

If you specify devModName, the device MODULE name is prefixed to the return value. For example, if you access a library file through the LIB device MODULE:

$currentDirectory("lib(foo.lib)" & $devModBrkStr);

returns "lib(foo.lib)>/" (if you have not changed the current LIB directory from the initial default).


previous   next   top   contents   index   framed top   this page unframed

MAINSAIL Language Manual, Section 32.79