HP Pascal/iX Reference Manual (31502-90022)

10- 25
11.0
11
1.9111099243164L+01
TRUE
TR
MAYBE
writedir
Usage
writedir
(f, k, e)
writedir
(f, k, e1, ..., en)
Parameter
f
A file variable opened in direct access state.
k
The integer index of a component of
f
.
e
An expression whose result type must be assignment compatible with
the components of
f
.
Description
The procedure writedir
(f, k, e)
places the current position at the
component of
f
specified by
k
, and then writes the value of
e
to that
component. It is equivalent to:
seek(f,k);
write(f,e)
An error occurs if
f
has not been opened in the direct-access state or if
k
is greater than maxpos
(f)
. After writedir executes, the buffer
variable
f
^ is undefined, and the current position is
k
+ n, where n is
from en.
Example
writedir(fil_var,indx,exp)
writedir(fil_var,indx,exp1,....,expn)
Illustration
Suppose file examp_file is a file of integer opened for direct access.
The current position is the third component. To write a number to the
first component, we call writedir: