Statements used in manipulating file contents must be appropriate to the mode in which the file was opened. This error has the following causes and solutions:

  • Put or Get statement is specifying a sequential file. Put and Get can only refer to files opened for Random or Binary access.
  • Print # statement specifies a file opened for an access mode other than Output or Append. Use a different statement to place data in the file or reopen the file in an appropriate mode.
  • An Input # statement specifies a file opened for an access mode other than Input. Use a different statement to place data in the file or reopen the file in Input mode.
  • You attempted to write to a read-only file. Change the read/write status of the file or don’t try to write to it.