HP Pascal/iX Reference Manual (31502-90022)

3- 17
BEGIN
rewrite(myfile);
writeln(myfile,'integer',i);
writeln(myfile,'real',r);
END.
input
When the standard textfile
input
appears as a program parameter, there
are several important consequences:
*
Input
may not be declared in the global declaration of the source
code.
* The system automatically associates
input
with an
implementation-dependent physical file.
* The system automatically resets
input
.
* If certain file operations omit the logical file name parameter,
input
is the default file. For example, the call read(x) where x
is some variable, reads a value from
input
into x. Consider:
PROGRAM mute (input);
VAR answer : string[255];
BEGIN
readln(answer);
END.
The program waits for input. Output need not appear.
If an imported module uses
input
, it must appear as a program parameter
for the importing program, and the module must import the predefined
module
stdinput
.
output
When the standard textfile
output
appears as a program parameter, there
are several important consequences:
*
Output
may not be declared in the global declaration part of the
source code.
* The system automatically associates
output
with an implementation
dependent, physical file. Depending on your implementation, refer
to the
HP Pascal/iX Programmer's Guide
or the
HP Pascal/HP-UX
Programmer's Guide
for more information.
* The system automatically rewrites
output
.
* If certain file operations omit the logical file name parameter,
output
is the default file. For example, the call write(x), where
x is some variable, writes the value of x onto
output
. Consider:
PROGRAM sample (output);
BEGIN
writeln('I like Pascal!');
END.
The program displays the string literal on the default output device.
output
must appear as a program parameter;
input
need not appear if the
program does not use it.
If an imported module uses
output
, it must appear as a program parameter
for the importing program, and the module must import the predefined
module
stdoutput
.
Record