SET PREFIX
Set Prefix Path Names
This directive specifies alternate directory path names for Thoroughbred Basic to locate a file when Thoroughbred Basic did not find the file on the current directory. This directive does not change the current directory.
Syntax
Section titled “Syntax”SET PREFIX string-value [,ERR=line-ref|,ERC=error-code]string-value- is any string that contains 1 or more valid path names for a directory.
line-ref- is the program line number or label to branch to if this directive produces an error.
error-code- is a programmer-defined error code. Valid values are positive or negative whole numbers.
Remarks
Section titled “Remarks”This directive is generally available starting with release level 8.1.
A hierarchical directory must be set in the IPL file for Thoroughbred Basic to locate a file using the path names in PREFIX.
Multiple path names can be specified in string-value by separating the path names by 1 or more spaces.
If the pathname begins with a slash (Microsoft Windows: a backslash), Thoroughbred Basic assumes that the path begins with the root directory. If the path does not begin with a slash (Microsoft Windows: a backslash), Thoroughbred Basic assumes that the path begins with the current directory. You can use 2 periods (..) as a synonym for the parent directory and 1 period (.) as a synonym for the current directory.
A trailing slash (Microsoft Windows: a trailing backslash) on the directory path is accepted but not required.
If the SET PREFIX directive specifies an invalid or nonexistent path name, it is ignored and no error is generated.
The maximum length for a path name is 64 characters. If Thoroughbred Basic uses a path name from SET PREFIX that exceeds 64 characters, an ERR=41 results.
The maximum number of path names is 20. If SET PREFIX specifies more than 20 path names, an ERR=41 results.
The PREFIX system variable returns the current PREFIX string-value set by the last SET PREFIX.
The path names specified in the SET PREFIX string-value are used as alternate directory names when Thoroughbred Basic cannot locate the file using the current directory. The alternate path names are used in sequential order (left to right) to locate the file.
Note:
The PREFIX is used only to locate a file and never to create a file.
To avoid redundancy, the full path of any PREFIX directory should not match the full path of the current directory.
Examples
Section titled “Examples”SET PREFIX "/usr/lib/basic/IDL4 / usr/lib/basic/TEMP /usr/lib/DATA"assigns three directory paths to the PREFIX: /usr/lib/basic/IDL4, /usr/lib/basic/TEMP, and /usr/lib/DATA.
SET PREFIX X$If X$ = “/usr/lib/basic/DATA/BACKUP”, assigns this directory path to the PREFIX.
See also
Section titled “See also”SET DIR directive
DIR and PREFIX system variables
From the Thoroughbred Basic Language Reference, Volume III: R–Z, version 8.9.1. Open this page in the PDF