Run members from a library
- Last Updated: January 16, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
The difference between running a procedure from an operating system file and running a member from a library is in how you reference it. You can reference both using either absolute or relative pathnames.
Use an absolute pathname
The most efficient but least flexible way to reference r-code in a library is by using an absolute pathname. When you reference a member using an absolute pathname, OpenEdge does not search the PROPATH. It looks for the member in the specified directory.
To run a procedure from an operating system file in a specific directory, reference the procedure using an absolute pathname. For example:
|
However, to run a member from a library in a specific directory, you must reference both the library and the member with an absolute pathname. For example:
|
When you reference a member in a specific library, you must enclose the member name in double angle brackets as shown.
Use a relative pathname
The most flexible but least efficient way to reference r-code in a library is by using a pathname relative to a location on the PROPATH. When you reference a member using a relative pathname, OpenEdge searches the PROPATH.
When you reference a member in an unspecified library using a relative pathname, OpenEdge searches each directory and library defined in the PROPATH until it finds the first occurrence of the procedure. For example:
|
When you reference a member in a specific library using a relative pathname, OpenEdge searches the PROPATH until it finds the first occurrence of the library. For example:
|
When you reference a member in a specific library, you must enclose the member name in double angle brackets as shown.
The most flexible way to find r-code is to specify relative pathnames for all procedures run in your application. This enables you to include a procedure in a library at deployment, but maintain separate procedure and r-code files during development. In a development environment, either place the library in the PROPATH after your development directories or omit it from the PROPATH entirely. In a production environment, place the library at or near the beginning of the PROPATH to avoid long searches.
For more information about how libraries interact with PROPATH, see Libraries and PROPATH. For more
information about the RUN statement, see ABL Reference.
Related functions
If a file is in a library, the SEARCH
function returns the file's pathname using the following syntax:
|
For example:
|
Other ABL functions make use of this syntax. The LIBRARY function parses the pathname and returns the name of the library (in
this example, /usr/dictionary/dictionary.pl or
/usr/dictionary/dictionary.apl). If the argument to LIBRARY is not in the form library-pathname<<member-name>>, the LIBRARY function returns the Unknown value (?). This is also
true of the MEMBER function, which parses the pathname and
returns the name of the member file (in this example, dict.r).
For more information about the SEARCH,
LIBRARY, and MEMBER
functions, see ABL Reference.