
{ Uses the variable IOerror declared at the beginning of the library to
  determine if an I/O error has occured and display the corresponding
  error message in the status line.
  example:  Repeat
              Reset (filename.ext); IOcheck
            Until Not IOerror; }

Procedure IOcheck;
  Var
    IOcode    : Integer;
    Ch        : Char;
  Begin
    IOcode := IOresult;
    IOerror := (IOcode <> 0);
    If IOerror then
    Begin
      Case IOcode Of
        $01   : Write_Status ('+++ File Does NOT Exist +++');
        $02   : Write_Status ('+++ File NOT Open For INPUT +++');
        $03   : Write_Status ('+++ File NOT Open For OUTPUT +++');
        $04   : Write_Status ('+++ File NOT Open +++');
        $10   : Write_Status ('+++ ERROR In Numeric Format +++');
        $20   : Write_Status ('+++ Operation NOT Allowed On LOGICAL Device +++');
        $21   : Write_Status ('+++ NOT Allowed In DIRECT Mode +++');
        $22   : Write_Status ('+++ Assign To STANDARD Files NOT Allowed +++');
        $90   : Write_Status ('+++ RECORD Length Mismatch +++');
        $91   : Write_Status ('+++ Seek BEYOND End-Of-File +++');
        $99   : Write_Status ('+++ UNEXPECTED End-Of-File +++');
        $F0   : Write_Status ('+++ Disk WRITE Error +++');
        $F1   : Write_Status ('+++ Directory Is FULL +++');
        $F2   : Write_Status ('+++ File SIZE Overflow +++');
        $F3   : Write_Status ('+++ Too MANY Open FILES +++');
        $FF   : Write_Status ('+++ File DISAPPEARED +++');
      Else
                Write_Status ('+++ Unknown I/O ERROR +++');
      End;
      Read(Kbd,Ch)
    End
  End;
