6.5.5 It is an error to alter the value of a
file-variable f when a reference to
the buffer-variable f^ exists.
According to ISO/IEC 7185 there are four ways of establishing a reference to a variable.
So for example, it would be an error if you pass a file buffer by reference to a procedure
and that procedure performs I/O on the file associated with the file buffer.
- Passing the variable by reference establishes a reference to the variable for the life
of the function or procedure call.
- Using an assignment statement to assign a value
to the variable, establishes a reference to the variable starting either before or after
the expression on the right-hand side of the
assignment statement is evaluated, and lasting until the value has been assigned to the
- Using the variable in a with statement establishes
a reference to the variable that exists during the execution of the
statement in the
- Establishing a reference to a component of the variable, also establishes a reference to
the variable as a whole.
This error is never reported.