HP Pascal/iX Reference Manual (31502-90022)
Table Of Contents
- Top of Document
- Preface
- Chapter 1 Introduction
- Chapter 2 Language Elements
- Chapter 3 Data Types
- Chapter 4 Expressions
- Chapter 5 The Declaration Section
- Chapter 6 Statements
- Chapter 7 Program Structure
- Chapter 8 Procedures and Functions
- Chapter 9 Standard Routines
- Chapter 10 Input and Output
- Chapter 11 System Programming Extensions
- Chapter 12 Compiler Options
![](/manual/hp/mpe-ix-7-5-operating-system/hp-pascalix-reference-manual-31502-90022/images/img-43.png)
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