home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TOOL_INC.ZIP / ERRMSG.INC < prev    next >
Encoding:
Text File  |  1988-01-29  |  2.0 KB  |  63 lines

  1.  
  2. (*
  3.  * return error message based on tpas 4.0 runtime error codes
  4.  * s.h.smith, 5-jan-88 (6-jan-88)
  5.  *
  6.  *)
  7. function errormsg(code: integer): string;
  8. var
  9.    class:  string;
  10.    msg:    string;
  11. begin
  12.    case code of
  13.         1..99:  class := 'DOS';
  14.       100..149: class := 'I/O';
  15.       150..199: class := 'CRITICAL';
  16.       200..249: class := 'FATAL';
  17.       else      class := 'UNKNOWN';
  18.    end;
  19.  
  20.    case code of
  21.         2: msg := 'File not found';
  22.         3: msg := 'Path not found';
  23.         4: msg := 'Too many open files';
  24.         5: msg := 'File access denied';
  25.         6: msg := 'Bad file handle';
  26.        12: msg := 'Bad file access code';
  27.        15: msg := 'Bad drive number';
  28.        16: msg := 'Can''t remove current dir';
  29.        17: msg := 'Can''t rename across drives';
  30.       100: msg := 'Disk read error';
  31.       101: msg := 'Disk write error';
  32.       102: msg := 'File not assigned';
  33.       103: msg := 'File not open';
  34.       104: msg := 'File not open for input';
  35.       105: msg := 'File not open for output';
  36.       106: msg := 'Bad numeric format';
  37.       150: msg := 'Disk is write-protected';
  38.       151: msg := 'Unknown unit';
  39.       152: msg := 'Drive not ready';
  40.       153: msg := 'Unknown command';
  41.       154: msg := 'CRC error in data';
  42.       155: msg := 'Bad drive request structure length';
  43.       156: msg := 'Disk seek error';
  44.       157: msg := 'Unknown media type';
  45.       158: msg := 'Sector not found';
  46.       159: msg := 'Printer out of paper';
  47.       160: msg := 'Device write fault';
  48.       161: msg := 'Device read fault';
  49.       162: msg := 'Hardware failure';
  50.       200: msg := 'Division by zero';
  51.       201: msg := 'Range check';
  52.       202: msg := 'Stack overflow';
  53.       203: msg := 'Heap overflow';
  54.       204: msg := 'Bad pointer operation';
  55.       205: msg := 'Floating point overflow';
  56.       206: msg := 'Floating point underflow';
  57.       207: msg := 'Bad floating point operation';
  58.       else str(code,msg);
  59.    end;
  60.  
  61.    errormsg := class + ': ' + msg;
  62. end;
  63.