home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / PNL Libraries / MyErrors.p < prev    next >
Encoding:
Text File  |  1995-01-16  |  622 b   |  33 lines  |  [TEXT/CWIE]

  1. unit MyErrors;
  2.  
  3. interface
  4.  
  5.     uses
  6.         Types;
  7.  
  8.     const
  9.         error_id = 925; { STR#, ERRS, ALRT, DITL.  override ERRS with ERRS=128 }
  10.  
  11.     procedure DisplayError (msg: integer; err: OSErr);
  12.  
  13. implementation
  14.  
  15.     uses
  16.         TextUtils, MyErrorStrings, QAlerts, MyStrings;
  17.  
  18.     procedure DisplayError (msg: integer; err: OSErr);
  19.         var
  20.             s, e: str255;
  21.     begin
  22.         if (err <> noErr) & (err <> userCanceledErr) then begin
  23.             if not ErrorString(128, err, e) then begin
  24.                 e := ErrorStr(error_id, err);
  25.             end;
  26.             GetIndString(s, error_id, msg);
  27.             SPrintS3(s, s, e, '', '');
  28.             QParamText('', s, '', '');
  29.             QStopAlert(error_id, nil);
  30.         end;
  31.     end;
  32.  
  33. end.