I/O error codes


The following trappable error codes may be returned from various operations. If automatic error trapping is enabled (the default situation) then the compiler generates code to automatically check operations for trappable errors and report any errors detected. If you want more control on how errors are handled you can disable error trapping using the built-in procedure TrapErrors, and then use the function GetLastError to check the last trappable error that occured.

Value Error Code                  Cause
  0   NoErrors                I/O operation completed successfully
  1   FileEraseFailure        Attempt to erase a file failed
  2   FileRenameFailure       Attempt to rename a file failed
  3   FileIsUndefined         Attempt to operate on an undefined file
  4   FileIsOpen              Using assign, erase, or rename on an open file
  5   FileIsNotOpen           Attempt to perform I/O on a closed file
  6   FileModeUndefined       THIS SHOULD NEVER OCCUR
  7   FileNameTooLong         Attempt to give a file a name too long
  8   FileNameNotDefined      Attempt to erase or rename a file with no name
  9   FilePosFailure          Attempt to use pos on a file failed
 10   FileSeekFailure         Attempt to use seek on a file failed
 11   NotOutputFile           Attempt to write to a file not open for writing
 12   UnexpectedEOF           Attempt to read past end-of-file
 13   WriteFailure            Attempt to write to file failed
 14   WidthTooLarge           Attempt to write a field too wide
 15   NotInputFile            Attempt to read from a file not open for reading
 16   ReadFailure             Attempt to read from file failed
 17   ClosingFailure          Attempt to close a file failed
 18   OpeningFailure          Attempt to open a file failed
 19   FileBufferIsEmpty       Attempt to use put and the file-buffer is empty
 20   ChDirFailure            Attempt to change directory failed
 21   FileExpandFailure       Attempt to use fexpand failed
 22   FileSplitFailure        Attempt to use fsplit failed
 23   FileSizeFailure         Attempt to obtain size of file failed
 24   FileOpenDirFailure      Attempt to open directory failed
 25   FileReadDirFailure      Attempt to read directory entry failed
 26   DirectoryIsUndefined    Attempt to access directory variable failed
 27   FileCloseDirFailure     Attempt to close directory failed
 28   FileRewindDirFailure    Attempt to rewind directory failed
 29   FileMkDirFailure        Attempt to create directory failed
 30   FileRmDirFailure        Attempt to remove directory failed
 31   FileGetDateFailure      Attempt to get the date a file was last modified failed
 32   FileGetModeFailure      Attempt to get the mode of a file failed
 33   FileGetTimeFailure      Attempt to get the time a file was last modified failed
 34   FileSetDateFailure      Attempt to set the date a file was last modified failed
 35   FileSetTimeFailure      Attempt to set the time a file was last modified failed
 36   FileRawReadFailure      Attempt to use rawread failed
 37   FileRawWriteFailure     Attempt to use rawwrite failed
 38   FileInternalFailure     THIS SHOULD NEVER OCCUR
 39   DatabaseFailure         Attempt to access database failed
 40   ObjectCreateFailure     Attempt to create  object failed
 41   ObjectGetOrFuncFailure  Attempt to get property to call method with no arguments failed
 42   ObjectFuncFailure       Attempt to call function method failed
 43   ObjectProcFailure       Attempt to call procedure method failed
 43   ObjectPutFailure        Attempt to set object property failed
 44   ObjectGenericFailure    Attempt to access generic object failed
 45   MemoryAllocationFailure Attempt to allocate memory failed
 46   InvokeException         A generic object instance raised an exception