FORTRAN Reference Manual

Utility Routines
FORTRAN Reference Manual528615-001
15-31
CHECKLOGICALNAME Routine
CHECKLOGICALNAME Routine
The CHECKLOGICALNAME routine checks whether a saved ASSIGN message with a
given logical file name exists. It also returns the message serial number associated
with the saved ASSIGN message.
result
is an integer variable in which CHECKLOGICALNAME returns the result of the
operation. See Considerations.
logicalname
is a character expression of up to 63 characters that specifies the program unit
name and the logical file name in one of the following two forms:
programunit.filename
*.filename
If the logical file name does not include the program unit name component, specify
only the file name. In either case logicalname cannot have leading spaces. Any
character including and following a blank is ignored.
Considerations
Values returned by CHECKLOGICALNAME:
result = CHECKLOGICALNAME ( logicalname )
Return Value Meaning
<0 The negated message number of a previously saved ASSIGN
message with a logical file name that conflicts with the one
supplied. The logical file names conflict if only one is qualified or
if one is qualified by “*” and the other is qualified by a program
name. If there are more than one conflicting saved ASSIGN
messages, the negative of the message number of the first
ASSIGN message located is returned.
0 An ASSIGN message containing the specified logical file name
does not exist.
>0 Is the message number of the saved ASSIGN message with the
logical file name that matches the one supplied.