
 unit Errors_E;

 interface

 const
      NomConfig = 'MMP.CFG';

 const
      Err_2  = 'File not found';
      Err_3  = 'Path not found';
      Err_4  = 'Too many open files';
      Err_5  = 'Access to file denied';
      Err_8  = 'Can''t run un-archiver';
      Err_10 = 'BLASTER environment string invalid';
      Err_11 = 'Sound Blaster card not found';
      Err_12 = 'Invalid IRQ line';
      Err_13 = 'DSP v2.00+ required for DMA auto-initialize mode';
      Err_14 = 'BLASTER environment string not found';
      Err_15 = 'Insufficient DOS memory, initialization impossible';
      Err_16 = 'DMA buffer initialization impossible';
      Err_17 = 'Invalid number of patterns or invalid file';
      Err_18 = 'No more files';
      Err_38 = 'Too many patterns present or invalid file';
      Err_19 = 'Truncated file, patterns data are altered';
      Err_20 = 'Too many instruments or invalid file';
      Err_21 = 'Empty order list or invalid file';
      Err_22 = 'Adlib instruments not supported';
      Err_23 = 'Stereo samples not supported';
      Err_24 = 'Unknown file type';
      Err_25 = 'Error reading pattern';
      Err_27 = 'No more handles for EMS';
      Err_28 = 'XMS ';
      Err_29 = 'EMS ';
      Err_30 = 'EMS error while switching page on sample ';
      Err_31 = 'insufficient by ';
      Err_32 = ' KB';
      Err_33 = 'Not enough DOS memory for patterns';
      Err_34 = 'Not enough DOS memory for temporary buffers';
      Err_35 = 'unavailable';
      Err_41 = 'Invalid output frequency in '+NomConfig;
      Err_42 = 'Error reading '+NomConfig;
      Err_44 = 'Configuration file '+NomConfig+' invalid';
      Err_45 = 'Error opening '+NomConfig;
      Err_46 =  NomConfig+' version invalid';
      Err_47 = 'Error writing '+NomConfig;
      Err_49 = 'Error writing '+NomConfig+', insufficient memory';
      Err_50 = 'Sample(s) truncated to 64 KB. Disable EMM386, QEMM ...';
      Err_51 = 'Invalid patterns or invalid file';
      Err_52 = 'Error allocating DOS buffer for XMS mode';
      Err_53 = 'Truncated file, samples data may be altered';
      Err_54 = 'Internal error. Contact the author';
      Err_55 = 'Read only media';
      Err_56 = 'List file creation impossible';
      Err_57 = 'Invalid number of channels or altered header';
      Err_59 = 'Too many samples or invalid file';
      Err_60 = 'Sorry, XM files must be v1.04+';
      Err_61 = 'Invalid archive file';
      Err_62 = 'File extraction failed';
      Err_100 = 'Error while reading';
      Err_103 = 'File not opened';
      Err_152 = 'Disk unit not ready';
      Err_154 = 'CRC error in data';
      Err_156 = 'Seek error';
      Err_157 = 'Unknown media type';
      Err_158 = 'Sector not found';

  var
     Err_99 : string[80] ;

 function Error_Msg(ErrorNum:integer):string;

 implementation

 function Error_Msg;
  var
     Msg,EMsg   : string[80];
     ErrSt      : string[3];
  begin
       EMsg:='';
       if ErrorNum>0 then
        begin
         str(ErrorNum,ErrSt);
         EMsg:='Error '+ErrSt;
         Msg:='';
         case ErrorNum of
           99:Msg:=Err_99;
            2:Msg:=Err_2;
            3:Msg:=Err_3;
            4:Msg:=Err_4;
            5:Msg:=Err_5;
           10:Msg:=Err_10;
           11:Msg:=Err_11;
           12:Msg:=Err_12;
           13:Msg:=Err_13;
           14:Msg:=Err_14;
           15:Msg:=Err_15;
           16:Msg:=Err_16;
           17:Msg:=Err_17;
           18:Msg:=Err_18;
           19:Msg:=Err_19;
           20:Msg:=Err_20;
           21:Msg:=Err_21;
           22:Msg:=Err_22;
           23:Msg:=Err_23;
           24:Msg:=Err_24;
           25:Msg:=Err_25;
           27:Msg:=Err_27;
           28:Msg:=Err_20;
           29:Msg:=Err_29;
           30:Msg:=Err_30;
           31:Msg:=Err_31;
           32:Msg:=Err_32;
           33:Msg:=Err_33;
           34:Msg:=Err_34;
           35:Msg:=Err_35;
           38:Msg:=Err_38;
           41:Msg:=Err_41;
           42:Msg:=Err_42;
           44:Msg:=Err_44;
           45:Msg:=Err_45;
           46:Msg:=Err_46;
           47:Msg:=Err_47;
           49:Msg:=Err_49;
           50:Msg:=Err_50;
           51:Msg:=Err_51;
           52:Msg:=Err_52;
           53:Msg:=Err_53;
           54:Msg:=Err_54;
           55:Msg:=Err_55;
           56:Msg:=Err_56;
           57:Msg:=Err_57;
           59:Msg:=Err_59;
           60:Msg:=Err_60;
           61:Msg:=Err_61;
           62:Msg:=Err_62;
          100,161:Msg:=Err_100;
          103:Msg:=Err_103;
          152:Msg:=Err_152;
          154:Msg:=Err_154;
          156:Msg:=Err_156;
          157:Msg:=Err_157;
          158:Msg:=Err_158;
         end;
         if Msg>'' then EMsg:=EMsg+' : '+Msg;
      end;
      Error_Msg:=EMsg;
  end;


 end.