home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / TURBOPAS / PC_DISK.ZIP / PC-DISK4.INC < prev    next >
Encoding:
Text File  |  1985-07-23  |  23.4 KB  |  587 lines

  1. {---------READAXSD-----------Read comments from AUTODEX or SDIR files-------}
  2. {---------------Replace the procedure  Update_Disk with this file-----------}
  3.  
  4. type commentype_np=array[1..Max_Records] of Record
  5.                      thecomment:memo_type;
  6.                      thefile:fname_type;
  7.                    end;
  8.   commentype=^commentype_np;
  9.  
  10. function DIDFileName:fname_type;
  11. {
  12.   This program returns the name of the .DID file on the default disk, or
  13.   the null string if there is no .DID file
  14. }
  15. type
  16.   Char12arr            = array [ 1..12 ] of Char;
  17.   String20             = string[ 20 ];
  18.   RegRec =
  19.     record
  20.       AX, BX, CX, DX, BP, SI, DI, DS, ES, Flags : Integer;
  21.     end;
  22.  
  23. var  NumFiles : integer;
  24.   Regs                 : RegRec;
  25.   DTA                  : array [ 1..43 ] of Byte;
  26.   Mask                 : Char12arr;
  27.   NamR                 : String20;
  28.   Error, I             : Integer;
  29.  
  30. begin
  31.   FillChar(DTA,SizeOf(DTA),0);        { Initialize the DTA buffer }
  32.   FillChar(Mask,SizeOf(Mask),0);      { Initialize the mask }
  33.   FillChar(NamR,SizeOf(NamR),0);      { Initialize the file name }
  34.   NumFiles := 0;
  35.   Regs.AX := $1A00;         { Function used to set the DTA }
  36.   Regs.DS := Seg(DTA);      { store the parameter segment in DS }
  37.   Regs.DX := Ofs(DTA);      {   "    "      "     offset in DX }
  38.   MSDos(Regs);              { Set DTA location }
  39.   Error := 0;
  40.   Mask := '????????.DID';    { Use global search }
  41.   Regs.AX := $4E00;          { Get first directory entry }
  42.   Regs.DS := Seg(Mask);      { Point to the file Mask }
  43.   Regs.DX := Ofs(Mask);
  44.   Regs.CX := 22;             { Store the option }
  45.   MSDos(Regs);               { Execute MSDos call }
  46.   Error := Regs.AX and $FF;  { Get Error return }
  47.   I := 1;                    { initialize 'I' to the first element }
  48.   if (Error = 0) then
  49.     repeat
  50.       NamR[I] := Chr(Mem[Seg(DTA):Ofs(DTA)+29+I]);
  51.       I := I + 1;
  52.     until not (NamR[I-1] in [' '..'~']) or (I>20);
  53.  
  54.   NamR[0] := Chr(I-1);          { set string length because assigning }
  55.                                 { by element does not set length }
  56.   DIDFileName := NamR;
  57.  
  58. end; { procedure DirList  }
  59.  
  60.  
  61. function UpC(name:fname_type):fname_type;
  62.  
  63. var temp:fname_type;
  64.   I:integer;
  65.  
  66. begin
  67.   for i := 0 to length(name) do
  68.     temp[i] := UpCase(name[i]);
  69.   UpC := temp;
  70. end; {then}
  71.  
  72.  
  73. function CompareFileNames(name1,name2:fname_type):boolean;
  74.  
  75. begin
  76.   While pos('.',name1)>0 do delete(name1,pos('.',name1),1);
  77.   While pos('.',name2)>0 do delete(name2,pos('.',name2),1);
  78.   While pos(' ',name1)>0 do delete(name1,pos(' ',name1),1);
  79.   While pos(' ',name2)>0 do delete(name2,pos(' ',name2),1);
  80.   CompareFileNames := UpC(name1)<>UpC(name2);
  81. end;  {function}
  82.  
  83. procedure GetAxComments(var comments:commentype;var NumberOfComments:integer);
  84.  
  85. type strings=array[1..47] of char;
  86.  
  87. var tempstr:string[47];
  88.   i:integer;
  89.   garbage:char;
  90.   infile:text;
  91.   temporary:strings;
  92.  
  93. begin
  94.   tempstr := DIDFileName+'D';
  95.   assign(infile,tempstr);
  96.   reset(infile);
  97.   readln(infile);readln(infile);
  98.   NumberOfComments := 0;
  99.   While not eof(infile) do
  100.     begin
  101.       NumberOfComments := NumberOfComments + 1;
  102.       for i := 1 to 13 do read(infile,garbage);
  103.       for i := 1 to 13 do read(infile,temporary[i]);
  104.       tempstr := temporary;
  105.       Delete(tempstr,pos('.',tempstr),1);
  106.       Comments^[NumberOfComments].TheFile := copy(Tempstr,1,11);
  107.       for i := 1 to 7 do read(infile,garbage);
  108.       for i := 1 to 47 do temporary[i] := ' ';
  109.       i := 1;
  110.       While not eoln(infile) do
  111.         begin read(infile,temporary[i]); i := i+1; end;  {while}
  112.       tempstr := temporary;
  113.       Comments^[NumberOfComments].TheComment := copy(Tempstr,1,33);
  114.       readln(infile);
  115.     end;  {while}
  116.   close(infile);
  117. end;  {procedure}
  118.  
  119. Procedure GetSdComments(var comments:commentype;var NumberOfComments:integer);
  120.  
  121. type strings=array[1..47] of char;
  122.  
  123. var tempstr:string[47];
  124.   i:integer;
  125.   garbage:char;
  126.   infile:text;
  127.   temporary:strings;
  128.  
  129. begin
  130.   assign(infile,'SDIR.$$$');
  131.   reset(infile);
  132.   NumberOfComments := 0;
  133.   while not eof(infile) do
  134.     begin
  135.       NumberOfComments := NumberOfComments + 1;
  136.       for i := 1 to 47 do temporary[i] := ' ';
  137.       for i := 1 to 12 do read(infile,temporary[i]);
  138.       tempstr := temporary;
  139.       Delete(tempstr,pos('.',tempstr),1);
  140.       comments^[NumberOfComments].TheFile := Copy(tempstr,1,11);
  141.       for i := 1 to 27 do read(infile,garbage);
  142.       for i := 1 to 47 do temporary[i] := ' ';
  143.       for i := 1 to 41 do read(infile,temporary[i]);
  144.       tempstr := temporary;
  145.       comments^[NumberOfComments].TheComment := Copy(tempstr,1,33);
  146.     end;  {while}
  147.   close(infile);
  148. end;  {procedure}
  149.  
  150.  
  151. procedure ReadAxSd(ax:boolean);
  152.  
  153. label EndProc;
  154.  
  155. var comments:commentype;
  156.   tempint17:integer;
  157.   Numberofcomments:integer;
  158.  
  159. begin
  160.   changed := true;
  161.   New(comments);
  162.   If ax then GetAxComments(comments,Numberofcomments) else GetSdComments(comments,numberofcomments);
  163.   found := false;
  164.   writeln;
  165.   get_vol;
  166.   if volume <> '' then
  167.     begin
  168.       writeln;
  169.       for x := 1 to vol_num do
  170.         begin
  171.           If vol_array[x]=volume then
  172.             begin
  173.               found := true;
  174.               t1 := x;
  175.               t4 := x;
  176.             end;
  177.          end;
  178.       If not Found then
  179.         begin
  180.           t1 := 0;
  181.           t4 := vol_num;
  182.           cat_num := cat_num + 1;
  183.           vol_array[vol_num] := volume;
  184.           cat_array[cat_num].vol_record := -1;
  185.           cat_array[cat_num].fil := volume;
  186.           cat_array[cat_num].memo := 'Volume Label';
  187.         end;  {then}
  188.       writeln;
  189.       vol_min := 0;
  190.       vol_max := 0;
  191.       writeln ('Reading catalog..  One moment...');
  192.       t2 := 0;  { count files found on disk }
  193.       for x := 1 to cat_num  do
  194.         if (cat_array[x].vol_record = t1) and (vol_min = 0) then
  195.           vol_min := x
  196.         else
  197.           if (vol_min <> 0 ) and (vol_max = 0) and (cat_array[x].vol_record <> t1) then
  198.             vol_max := x - 1 ;
  199.       If not Found then vol_min := cat_num+1;
  200.       if vol_max = 0 then vol_max := cat_num;
  201.       msdos11(3);
  202.       if (r.ax and 255) = 0 then
  203.         begin
  204.           while (r.ax and 255) = 0 do
  205.             begin {q1}
  206.               t2 := t2 + 1;
  207.               temp := '';
  208.               for x := 8 to 18 do
  209.                 temp := temp + chr(mem[seg(dta^):ofs(dta^)+x]);
  210.               temp_array[t2].fil := temp;
  211.               temp_array[t2].sizelo[1] := chr(mem[seg(dta^):ofs(dta^)+36]);
  212.               temp_array[t2].sizelo[2] := chr(mem[seg(dta^):ofs(dta^)+37]);
  213.               temp_array[t2].sizehi[1] := chr(mem[seg(dta^):ofs(dta^)+38]);
  214.               temp_array[t2].sizehi[2] := chr(mem[seg(dta^):ofs(dta^)+39]);
  215.               temp_array[t2].time[1] := chr(mem[seg(dta^):ofs(dta^)+30]);
  216.               temp_array[t2].time[2] := chr(mem[seg(dta^):ofs(dta^)+31]);
  217.               temp_array[t2].date[1] := chr(mem[seg(dta^):ofs(dta^)+32]);
  218.               temp_array[t2].date[2] := chr(mem[seg(dta^):ofs(dta^)+33]);
  219.               {-- now find old entry if any --}
  220.               found := false;
  221.               for x := vol_min to vol_max do
  222.                 begin
  223.                   if cat_array[x].fil = temp then
  224.                     begin
  225.                       found := true;
  226.                       t3 := x;
  227.                     end;
  228.                 end;
  229.               tempint17 := 1;
  230.               while (tempint17<Numberofcomments)
  231.                and CompareFileNames(temp_array[t2].fil,comments^[tempint17].thefile)
  232.                 do tempint17 := tempint17+1;
  233.               If CompareFileNames(temp_array[t2].fil,comments^[tempint17].thefile)
  234.                 then temp_array[t2].memo := ''
  235.                 else temp_array[t2].memo := comments^[tempint17].thecomment;
  236.               msdos12;
  237.             end
  238.         end;
  239.       If t1=0 then
  240.         begin
  241.           for x := 1 to t2 do begin
  242.             cat_array[x+cat_num].vol_record := t4;
  243.             cat_array[x+cat_num].fil := temp_array[x].fil;
  244.             cat_array[x+cat_num].sizelo := temp_array[x].sizelo;
  245.             cat_array[x+cat_num].sizehi := temp_array[x].sizehi;
  246.             cat_array[x+cat_num].time := temp_array[x].time;
  247.             cat_array[x+cat_num].date := temp_array[x].date;
  248.             cat_array[x+cat_num].memo := temp_array[x].memo;
  249.           end;  {for}
  250.           cat_num := cat_num + t2;
  251.           goto EndProc;
  252.         end;  {then}
  253.       t1 := vol_max - vol_min + 1;
  254.       if t1 < t2 then
  255.         begin
  256.           {check to see if we will overrun the array}
  257.           if (cat_num + (t2 - t1)) > max_records then
  258.             begin
  259.               writeln ('Maximum of ',max_records,' files exceeded by ',cat_num + t2 - t1 - max_records,'.');
  260.               writeln ('Truncating to ',max_records);
  261.             end;
  262.           {move the file up t2 - t1 records}
  263.           for x := (cat_num + t2 - t1) downto (vol_max + t2-t1 + 1) do
  264.             cat_array[x] := cat_array[x - t2+t1];
  265.           cat_num := cat_num + t2 - t1;
  266.           {insert temp array}
  267.           for x := 1 to t2 do
  268.             begin
  269.               cat_array[x + vol_min - 1].fil := temp_array[x].fil;
  270.               cat_array[x + vol_min - 1].sizelo := temp_array[x].sizelo;
  271.               cat_array[x + vol_min - 1].sizehi := temp_array[x].sizehi;
  272.               cat_array[x + vol_min - 1].time := temp_array[x].time;
  273.               cat_array[x + vol_min - 1].date := temp_array[x].date;
  274.               cat_array[x + vol_min - 1].memo := temp_array[x].memo;
  275.               cat_array[x + vol_min - 1].vol_record := t4;
  276.             end;
  277.         end
  278.       else  {the temp will fil in the old slot}
  279.         if t1 > t2 then
  280.           begin
  281.             {insert temp array at vol_min}
  282.             for x := 1 to t2 do
  283.               begin
  284.                 cat_array[x + vol_min - 1].fil := temp_array[x].fil;
  285.                 cat_array[x + vol_min - 1].sizelo := temp_array[x].sizelo;
  286.                 cat_array[x + vol_min - 1].sizehi := temp_array[x].sizehi;
  287.                 cat_array[x + vol_min - 1].time := temp_array[x].time;
  288.                 cat_array[x + vol_min - 1].date := temp_array[x].date;
  289.                 cat_array[x + vol_min - 1].memo := temp_array[x].memo;
  290.                 cat_array[x + vol_min - 1].vol_record := t4;
  291.               end;
  292.             { move the array down to meet it }
  293.             for x := (vol_max + t2-t1 + 1) to (cat_num + t2 - t1) do
  294.               cat_array[x] := cat_array[x -(t2-t1)];
  295.             cat_num := x;
  296.           end
  297.         else  { the replacement array is an exact match !}
  298.           for x := 1 to t2 do
  299.             begin
  300.               cat_array[x + vol_min - 1].fil := temp_array[x].fil;
  301.               cat_array[x + vol_min - 1].sizelo := temp_array[x].sizelo;
  302.               cat_array[x + vol_min - 1].sizehi := temp_array[x].sizehi;
  303.               cat_array[x + vol_min - 1].time := temp_array[x].time;
  304.               cat_array[x + vol_min - 1].date := temp_array[x].date;
  305.               cat_array[x + vol_min - 1].memo := temp_array[x].memo;
  306.               cat_array[x + vol_min - 1].vol_record := t4;
  307.             end;
  308.  
  309.       if cat_num = max_records then writeln ('The catalog is full.');
  310.     end
  311.   else
  312.     begin
  313.       writeln (' Cannot catalog a disk without a Volume Label.');
  314.       writeln (' Use funtion 7 on the Main Menu to add a Volume Label.');
  315.     end;
  316. EndProc:Dispose(Comments);
  317. end;
  318.  
  319. procedure update_disk;
  320. var choice,c_max:integer;
  321.   tempfile:text;
  322.   sd,ax:boolean;
  323. begin
  324.   drawbox (10,7,70,24,white,black,'[ Update Disk ]',blink_no);
  325.   found := false;
  326.   writeln;
  327.   writeln ('Place disk in drive ',default_drive,' and press any key...');
  328.   read (kbd,ch);
  329.   volume := '';
  330.   get_vol;
  331.   if volume <> '' then
  332.     begin
  333.       {scan the catalog for volume}
  334.       writeln;
  335.       changed := true;
  336.       for x := 1 to vol_num do
  337.         begin
  338.         if vol_array[x] = volume then
  339.           begin
  340.             found := true;
  341.             t1 := x;
  342.             t4 := x;
  343.           end;
  344.         end;
  345.       if found then  { Do a selective update/delete function }
  346.         begin
  347.           writeln ('Disk is already cataloged, performing update.');
  348.           writeln;
  349.           {$I-}
  350.           assign(tempfile,'SDIR.$$$');
  351.           reset(tempfile);
  352.           sd := IOResult=0;
  353.           ax := DIDFileName<>'';
  354.           close(tempfile);
  355.           {$I+}
  356.           writeln ('Disk already cataloged, Options: ');
  357.           writeln('   1) Use cataloged comments');
  358.           If not sd then
  359.             If ax then
  360.               writeln('   2) Read AX.COM file') else
  361.           else begin
  362.                  writeln('   2) Read SD.COM file');
  363.                  If ax then
  364.                    writeln('   3) Read AX.COM file');
  365.                end;  {else}
  366.           c_max := 3;
  367.           If not sd then c_max := 2;
  368.           if not ax then c_max := c_max-1;
  369.           If c_max=1 then choice := 1
  370.           else repeat
  371.                  write('   Your choice:');
  372.                  readln(choice);
  373.                until choice in [1..c_max];
  374.           If (not sd) and (choice=2) then choice := 3;
  375.           writeln;
  376.           Case choice of
  377.             2: ReadAxSd(false);
  378.             3: ReadAxSd(true);
  379.             1: begin
  380.                  vol_min := 0;
  381.                  vol_max := 0;
  382.                  t2 := 0;  { count files found on disk }
  383.                  for x := 1 to cat_num  do
  384.                    if (cat_array[x].vol_record = t1) and (vol_min = 0) then
  385.                      vol_min := x
  386.                    else
  387.                      if (vol_min <> 0 ) and (vol_max = 0) and (cat_array[x].vol_record <> t1) then
  388.                        vol_max := x - 1 ;
  389.                  if vol_max = 0 then vol_max := cat_num;
  390.                  msdos11(3);
  391.                  if (r.ax and 255) = 0 then
  392.                    begin
  393.                      while (r.ax and 255) = 0 do
  394.                        begin {q1}
  395.                          t2 := t2 + 1;
  396.                          temp := '';
  397.                          for x := 8 to 18 do
  398.                            temp := temp + chr(mem[seg(dta^):ofs(dta^)+x]);
  399.                          temp_array[t2].fil := temp;
  400.                          temp_array[t2].sizelo[1] := chr(mem[seg(dta^):ofs(dta^)+36]);
  401.                          temp_array[t2].sizelo[2] := chr(mem[seg(dta^):ofs(dta^)+37]);
  402.                          temp_array[t2].sizehi[1] := chr(mem[seg(dta^):ofs(dta^)+38]);
  403.                          temp_array[t2].sizehi[2] := chr(mem[seg(dta^):ofs(dta^)+39]);
  404.                          temp_array[t2].time[1] := chr(mem[seg(dta^):ofs(dta^)+30]);
  405.                          temp_array[t2].time[2] := chr(mem[seg(dta^):ofs(dta^)+31]);
  406.                          temp_array[t2].date[1] := chr(mem[seg(dta^):ofs(dta^)+32]);
  407.                          temp_array[t2].date[2] := chr(mem[seg(dta^):ofs(dta^)+33]);
  408.                          {-- now find old entry if any --}
  409.                          found := false;
  410.                          for x := vol_min to vol_max do
  411.                            begin
  412.                              if cat_array[x].fil = temp then
  413.                                begin
  414.                                  found := true;
  415.                                  t3 := x;
  416.                                end;
  417.                            end;
  418.                          if not found then
  419.                            begin
  420.                              write (temp,'  ');
  421.                              write (' New Memo > ');
  422.                              buflen := 33;
  423.                              readln (one_memo);
  424.                              temp_array[t2].memo := one_memo;
  425.                            end
  426.                          else
  427.                            begin
  428.                              writeln (temp,'   Memo > ',cat_array[t3].memo);
  429.                              write ('Replace [Y/N] ? ');
  430.                              repeat read (kbd,ch); until ch in yes_no;
  431.                              if upcase(ch) = 'Y' then
  432.                                begin
  433.                                  for q := 1 to 16 do write (chr(8)); clreol;
  434.                                  write (' New memo > ');
  435.                                  buflen := 33;
  436.                                  readln (one_memo);
  437.                                  temp_array[t2].memo := one_memo;
  438.                                end
  439.                              else
  440.                                begin
  441.                                  for q := 1 to 16 do write (chr(8)); clreol;
  442.                                  temp_array[t2].memo := cat_array[t3].memo;
  443.                                end;
  444.                            end;
  445.                          msdos12;
  446.                        end
  447.                    end;
  448.                  writeln ('Updating catalog..  One moment...');
  449.                  t1 := vol_max - vol_min + 1;
  450.                  if t1 < t2 then
  451.                    begin
  452.                      {check to see if we will overrun the array}
  453.                      if (cat_num + (t2 - t1)) > max_records then
  454.                        begin
  455.                          writeln ('Maximum of ',max_records,' files exceeded by ',cat_num + t2 - t1 - max_records,'.');
  456.                          writeln ('Truncating to ',max_records);
  457.                        end;
  458.                      {move the file up t2 - t1 records}
  459.                      for x := (cat_num + t2 - t1) downto (vol_max + t2-t1 + 1) do
  460.                        cat_array[x] := cat_array[x - t2+t1];
  461.                      cat_num := cat_num + t2 - t1;
  462.                      {insert temp array}
  463.                      for x := 1 to t2 do
  464.                        begin
  465.                          cat_array[x + vol_min - 1].fil := temp_array[x].fil;
  466.                          cat_array[x + vol_min - 1].sizelo := temp_array[x].sizelo;
  467.                          cat_array[x + vol_min - 1].sizehi := temp_array[x].sizehi;
  468.                          cat_array[x + vol_min - 1].time := temp_array[x].time;
  469.                          cat_array[x + vol_min - 1].date := temp_array[x].date;
  470.                          cat_array[x + vol_min - 1].memo := temp_array[x].memo;
  471.                          cat_array[x + vol_min - 1].vol_record := t4;
  472.                        end;
  473.                    end
  474.                  else  {the temp will fil in the old slot}
  475.                    if t1 > t2 then
  476.                      begin
  477.                        {insert temp array at vol_min}
  478.                        for x := 1 to t2 do
  479.                          begin
  480.                            cat_array[x + vol_min - 1].fil := temp_array[x].fil;
  481.                            cat_array[x + vol_min - 1].sizelo := temp_array[x].sizelo;
  482.                            cat_array[x + vol_min - 1].sizehi := temp_array[x].sizehi;
  483.                            cat_array[x + vol_min - 1].time := temp_array[x].time;
  484.                            cat_array[x + vol_min - 1].date := temp_array[x].date;
  485.                            cat_array[x + vol_min - 1].memo := temp_array[x].memo;
  486.                            cat_array[x + vol_min - 1].vol_record := t4;
  487.                          end;
  488.                        { move the array down to meet it }
  489.                        for x := (vol_max + t2-t1 + 1) to (cat_num + t2 - t1) do
  490.                          cat_array[x] := cat_array[x -(t2-t1)];
  491.                        cat_num := x;
  492.                      end
  493.                    else  { the replacement array is an exact match !}
  494.                      for x := 1 to t2 do
  495.                        begin
  496.                          cat_array[x + vol_min - 1].fil := temp_array[x].fil;
  497.                          cat_array[x + vol_min - 1].sizelo := temp_array[x].sizelo;
  498.                          cat_array[x + vol_min - 1].sizehi := temp_array[x].sizehi;
  499.                          cat_array[x + vol_min - 1].time := temp_array[x].time;
  500.                          cat_array[x + vol_min - 1].date := temp_array[x].date;
  501.                          cat_array[x + vol_min - 1].memo := temp_array[x].memo;
  502.                          cat_array[x + vol_min - 1].vol_record := t4;
  503.                        end;
  504.                end
  505.            end
  506.         end
  507.       else           { Do a Complete Add function }
  508.         begin
  509.           vol_num := vol_num + 1;
  510.           {$I-}
  511.           assign(tempfile,'SDIR.$$$');
  512.           reset(tempfile);
  513.           sd := IOResult=0;
  514.           ax := DIDFileName<>'';
  515.           close(tempfile);
  516.           {$I+}
  517.           writeln ('Disk not cataloged, Options: ');
  518.           writeln('   1) Enter comments');
  519.           If not sd then
  520.             If ax then
  521.               writeln('   2) Read AX.COM file') else
  522.           else begin
  523.                  writeln('   2) Read SD.COM file');
  524.                  If ax then
  525.                    writeln('   3) Read AX.COM file');
  526.                end;  {else}
  527.           c_max := 3;
  528.           If not sd then c_max := 2;
  529.           if not ax then c_max := c_max-1;
  530.           If c_max=1 then choice := 1
  531.             else repeat
  532.                    write('   Your choice: ');
  533.                    readln(choice);
  534.                  until choice in [1..c_max];
  535.           If (not sd) and (choice=2) then choice := 3;
  536.           writeln;
  537.           Case choice of
  538.             2: ReadAxSd(false);
  539.             3: ReadAxSd(true);
  540.             1: begin
  541.                 msdos11(3);
  542.                 if (r.ax and 255) = 0 then
  543.                   begin
  544.                     cat_num := cat_num + 1;
  545.                     vol_array[vol_num] := volume;
  546.                     cat_array[cat_num].vol_record := -1;  { -1 means this is a vol entry }
  547.                     cat_array[cat_num].fil := volume;
  548.                     cat_array[cat_num].memo := 'Volume Label';
  549.                     while ((r.ax and 255) = 0) and (cat_num < max_records + 1) do
  550.                       begin
  551.                         cat_num := cat_num + 1;
  552.                         temp := '';
  553.                         for x := 8 to 18 do
  554.                           temp := temp + chr(mem[seg(dta^):ofs(dta^)+x]);
  555.                         write (temp,'  ');
  556.                         write (' Memo > ');
  557.                         buflen := 33;
  558.                         readln (one_memo);
  559.                         cat_array[cat_num].vol_record := vol_num;
  560.                         cat_array[cat_num].fil := temp;
  561.                         cat_array[cat_num].sizelo[1] := chr(mem[seg(dta^):ofs(dta^)+36]);
  562.                         cat_array[cat_num].sizelo[2] := chr(mem[seg(dta^):ofs(dta^)+37]);
  563.                         cat_array[cat_num].sizehi[1] := chr(mem[seg(dta^):ofs(dta^)+38]);
  564.                         cat_array[cat_num].sizehi[2] := chr(mem[seg(dta^):ofs(dta^)+39]);
  565.                         cat_array[cat_num].time[1] := chr(mem[seg(dta^):ofs(dta^)+30]);
  566.                         cat_array[cat_num].time[2] := chr(mem[seg(dta^):ofs(dta^)+31]);
  567.                         cat_array[cat_num].date[1] := chr(mem[seg(dta^):ofs(dta^)+32]);
  568.                         cat_array[cat_num].date[2] := chr(mem[seg(dta^):ofs(dta^)+33]);
  569.                         cat_array[cat_num].memo := one_memo;
  570.                         msdos12;
  571.                       end {then}
  572.                   end {else}
  573.                 else
  574.                   writeln ('Disk has no files!');
  575.                end {case 1}
  576.            end
  577.         end;
  578.       if cat_num = max_records then writeln ('The catalog is full.');
  579.     end
  580.   else
  581.     begin
  582.       writeln (' Cannot catalog a disk without a Volume Label.');
  583.       writeln (' Use funtion 7 on the Main Menu to add a Volume Label.');
  584.     end;
  585.   write ('Press any key to continue');
  586.   read (kbd,ch);
  587. end;