Guardian Programmer's Guide

Table Of Contents
Manipulating File Names
Guardian Programmer’s Guide 421922-014
13 - 10
Resolving Names
.
OPTIONS := DEFINE^SIMPLE^RESOLVE;
ERROR := FILENAME_RESOLVE_(NAME:NAME^LENGTH,
FULLNAME:MAXLEN,
FULL^LENGTH,
OPTIONS);
IF ERROR <> 0 THEN
CASE ERROR OF
BEGIN
13 -> !DEFINE mode turned off
198 -> !No such DEFINE
OTHERWISE -> !Other error
END;
Resolving DEFINEs That Contain a File Name
Tape, spool, and map class DEFINEs that refer to file names can be reduced to the file
name that they refer to by setting the DEFINE-reduction flag (bit 11) in the
options parameter to 1. All other information contained in the DEFINE is unavailable
when the file name is used.
The DEFINE-reduction flag causes the FILENAME_RESOLVE_ procedure to return
the name of the file contained in the DEFINE (if there is one) or the DEFINE name if
there is none. If the DEFINE does not exist, then the procedure returns error 198. If
DEFINE mode is turned off, then error 13 is returned.
The following example returns the file name referred to in a tape, spool, or map
DEFINE.
LITERAL DEFINE^REDUCTION = %B0000000000010000;
.
.
OPTIONS := DEFINE^REDUCTION;
ERROR := FILENAME_RESOLVE_(NAME:NAME^LENGTH,
FULLNAME:MAXLEN,
FULL^LENGTH,
OPTIONS);
IF ERROR <> 0 THEN
CASE ERROR OF
BEGIN
13 -> !DEFINE mode turned off
198 -> !No such DEFINE
OTHERWISE -> !Other error
END;
Note that sort, catalog, defaults, and search DEFINEs cannot be resolved by this
option.