HP Pascal/iX Programmer's Guide (31502-90023)

A-: 2
Example
For more information on MPE/iX file names, refer to the
MPE/iX Commands
Reference Manual
.
Associating Logical and Physical Files
Your program does not affect its external environment unless its logical
files are associated with physical files at run-time. If they are, file
operations work concurrently on logical and physical files (see Chapter 3
).
In HP Pascal on the MPE/iX operating system, a logical file is associated
with a physical file under any one of the following conditions:
1. The name of the logical file is both a program parameter and the
first parameter of a predefined file-opening procedure. The
predefined file-opening procedure has no second parameter.
The operating system associates the logical file name with a
default physical file, whose name consists of the first eight
characters of the logical file name. This name must be an
acceptable MPE/iX file name (for example, it cannot contain an
underscore character (_)). If the default physical file does not
exist, HP Pascal creates a temporary physical file with that name.
Example
PROGRAM case_one (input,output,file1);
VAR
file1 : FILE OF integer;
BEGIN
reset(file1);
.
.
.
END.
The operating system associates the logical file file1 with the
physical file FILE1. If FILE1 does not exist, HP Pascal creates a
temporary file named FILE1.
The standard files
input
and
output
are exceptions to this scheme.
When they are program parameters, the operating system associates
them with the physical files $STDIN and $STDLIST, respectively.