HP Pascal/iX Reference Manual (31502-90022)

10- 7
Normally a file is closed upon exit from the block in which it is
declared. A file that has been disassociated will not be closed upon
exit, and must be explicitly closed with a direct call to the operating
system routines.
The disassociate procedure is useful when a file is passed to a Pascal
routine and must remain open when control returns to the routine that
passed the procedure to Pascal.
Example
disassociate (file_var)
eof
Usage
eof
(f)
eof
Parameter
f
A variable of type file that must be open. If
f
is omitted, the
system uses the standard file
input
.
Description
This Boolean function returns true if the end of a file is reached. If
the file
f
is open, the Boolean function eof(
f)
returns
true
when
f
is in
the output state, when
f
is in the direct access state, and its current
position is greater than the highest-indexed component ever written to
f
,
or when no component remains for sequential input. Otherwise, eof(
f)
returns false. If false, the next component is placed in the buffer
variable. If
f
is omitted, the system uses the standard file
input
.
When reading non-character values, such as integers or reals, from a
textfile, eof may remain false even if no other value of that type exists
in the file. This can occur if the remaining components are blanks; for
example, eoln is still false.
Example
eof
eof(file_var)
eoln
Usage
eoln
(f)
eoln
Parameter
f
A variable of type TEXT opened in the input state. If f is omitted,
the system uses the standard file
input
.
Description
This Boolean function returns true when the end of a line is reached in a
textfile. This happens when the current position of textfile
f
is at an
end-of-line marker. The function references the buffer variable
f
^,
possibly causing an input operation to occur. For example, after readln,
a call to eoln places the first character of the new line in the buffer
variable. If
f
is omitted, the system uses the standard file
input
.
Example
eoln
eoln(text_file)
get
Usage
get
(f)
get