6.6.5.2 It is an error if the file mode is not generation immediately prior to any use of put, write, writeln or page.
In other words, it is an error to perform output on a file which is not open for writing (i.e. the file is either not open or open for reading).
This error is reported if I/O checking is enabled.