.
contact contact


Using a path to access files

 
.
  File names may be specified in Eloquence using an absolute path (from the root of the file system) or relative to a volume label. When no volume label is specified the default volume label (MSI) is used.

A path specifies a list of file system locations (directories). If a path is defined it is used instead of the default volume label (MSI) to locate existing files.

A path is supported to load program files, open data files, to load forms and dialog files (text based dialog).


Path Elements

A path consists of one or more elements, separated by a colon (on HP-UX and Linux) or a semicolon (on Windows). For example,
.:EXAMPLE             (HP-UX and Linux)
.;EXAMPLE             (Windows)
This specifies a path with the current directory and the volume label "EXAMPLE".

The following path elements are supported:

  • An absolute directory starts with a slash (or with a backslash, a drive letter a colon and a backslash for Windows). For example,
    /opt/eloquence/8.2/share/prog
    C:\program files\eloquence\8.2\share\prog
    
    A trailing slash is implied or may be specified. Any leading or trailing spaces are ignored. On Windows, a slash or backslash may be used to separate directories.

  • A relative directory (relative to the current directory) is specified with a leading dot. For example,
    ./test
    
  • A volume label may be used to reference the path specified in the volume definition.

  • A relative path and a volume label (separated by comma). For example,
    test,LABEL
    
  • Anything else is considered a directory relative to the (current) MSI volume label. An empty element refers to the current MSI volume.
The following example defines a path consisting of the local directory, the current MSI volume and an absolute path.
.::/opt/eloquence/8.2/share/prog
.;;C:/program files/eloquence/share/prog

Defining a Path

A path may be defined in the Eloquence config file, through the EQPATH environment variable or by the application using the PATH statement.

Eloquence config file

The PATH config item may be used in the config file (eloq.config or .eloqrc) to specify a path. For example,
PATH ".:/opt/eloquence/8.2/share/prog"

The EQPATH environment variable

The EQPATH environment variable may be used to specify a path. If present, this has precedence over a definition in the config file. For example,
export EQPATH=.:/opt/eloquence/8.2/share/prog

The PATH statement

The PATH statement may be used to specify a path. This has precedence over a definition in the config file or the EQPATH environment variable. For example,
PATH ".:/opt/eloquence/8.2/share/prog"

Using a path

A path affects the LOAD and LOAD SUB statements that are used to load a program file. If a program file is loaded but neither an absolute path nor a volume label is present the path elements are tried in order to locate the file.

The PATH statement may be used by an application to specify a path. This path is active until another path is assigned. An empty string may be used to specify an empty path (and disable use of path).

The PATH$ function may be used to obtain the currently active path. It returns an empty string if no path is active.

The example below adds the "HOME" directory as a first element of the path and then loads the program file "START".

PATH GETENV$("HOME")&":"&PATH$
LOAD "START"
The example below locates the file TEST.DATA in any PATH component (if a path is defined) or the MSI (if no PATH is specified).
ASSIGN #1 TO "TEST"
However, please be aware that a PATH is only used to locate existing files. Creating a a new file will use MSI if no location is specified. Consequently, the stament below would create TEST.DATA in the directory defined by the MSI volume.
CREATE "TEST",0

 
 
.
 
 
  Privacy | Webmaster | Terms of use | Impressum Revision:  2023-01-20  
  Copyright © 2012-2023 Marxmeier Software AG