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
10- 8
Parameter
f
A variable of type file opened in input or direct access state. If
f
is omitted, the system uses the standard file
input
.
Description
The procedure get(
f)
advances the current file position and causes a
subsequent reference to the buffer variable
f^
to actually load the
buffer with the current component. This definition of get is known as
the
deferred get.
It is an error if
f
is in the output state or if eof(
f)
is true prior to
the call to get.
If a file is opened with open, a get must be performed to load the buffer
variable with valid data. However, if a file is opened with reset, the
buffer variable contains valid data and a get should not be performed
until the second component is accessed. If get is called after read, one
file component is skipped because read concludes with a get operation.
Example
get(file_var)
Illustration
Suppose examp_file is a logical file of char with three components which
has just been opened in the direct state. The current position is the
first component and examp_file^ is undefined. To inspect the first
component,
get
is called.
The current position is unchanged. Now, however, a reference to
examp_file^ loads the first component into the buffer. We assign the
buffer to a variable.