HP Pascal/iX Reference Manual (31502-90022)

10- 21
seek
Usage
seek
(f, k)
Parameters
f
A file variable that must be opened in the direct access state. It
may not be a textfile.
k
The integer index of a component of
f
. This must be an integer
expression >0.
Description
The procedure seek
(f, k)
places the current position of
f
at component
k
.
If
k
is greater than the index of the highest-indexed component ever
written to
f
, the function eof
(f)
returns true, otherwise false. The
buffer variable
f
^ is undefined following the call to seek. It is an
error if
f
is not open in the direct access state, or
k
is greater than
maxpos(
f
). The index,
k
, is relative to the beginning of the file.
Example
seek(file_var,indx)
Illustration
Suppose examp_file is a file of char with four components opened for
direct access. The current position is the second component. To change
it to the fourth component, seek is called.
write
Usage
write
(f, e)
write
(f, e1, ..., en)
write
(e)
write
(e1, ..., en)