home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / MBUG / MBUG094.ARC / NMANAGER.PAS < prev    next >
Pascal/Delphi Source File  |  1979-12-31  |  5KB  |  193 lines

  1.  
  2. {$R+}
  3.  
  4. Const
  5.    MaxDirSize=1100;
  6.  
  7. type
  8.     FileName= string[12];{e.g. FREDRICK.PAS}
  9.     BlockData=Array [0..15] of byte;
  10.     SectorBuff= array [0..127] of byte;
  11.     DirName = record
  12.                 DName:FileName;
  13.                 DTrack,DSector,DOffSet:integer;
  14.                 DExtNo,DUser:Byte
  15.               end;
  16.  
  17. var
  18.     Auto:Boolean; {True if auto printing for complete drive}
  19.  
  20. {$I DISPSECT.PRO}
  21.  
  22.  
  23.  
  24.  
  25. Procedure ScreenDump;
  26.  
  27. Var
  28.   line,column:integer;
  29.  
  30. Const
  31.   VideoStart=$F000;
  32.   Mask      =$7F;
  33.  
  34. begin
  35.   For line:= 0 to 23 do begin
  36.       For  column:=0 to 79 do
  37.            write(Lst,Char(Mem[VideoStart+line*80+column] and Mask));
  38.       Writeln(Lst);
  39.   end;
  40. end;
  41.  
  42. {$I NMANGR1.pro}
  43. {$I NMANGR2.PRO}
  44.  
  45. Procedure WSPFilesDspChg(WSpIndex:integer);
  46.  
  47. Var Response1,Loop1,PageStart:integer;
  48.  
  49. begin
  50.      With Directory[DirIndex[WSpIndex]] do  begin
  51.         GetRecord(DriveSelected,Dtrack,DSector);
  52.         for x:=0 to 15 do DirBlocks[x]:= DMA[DOffset+16+x]
  53.      end;
  54.      GetWSPFiles;
  55.      ShellSort(EndWSpDirPtr+1,EndOfDirectory);
  56.      FillIndex(WorkSpaceDirStart,EndWSpDirPtr+1,EndOfDirectory,WorkSpaceDirEnd);
  57.      WorkSpaceDirEnd:= WorkSpaceDirEnd-1;
  58.      If auto then
  59.       begin
  60.           With Directory[DirIndex[WSpIndex]] do
  61.                 WriteLn(lst,' ',DriveStr,':',Dname,#10);
  62.           Loop1:=4;
  63.           For Loop:=WorkSpaceDirStart to WorkSpaceDirEnd do
  64.            begin
  65.               If Loop1=4 then
  66.                begin
  67.                   Loop1:=0;
  68.                   WriteLn(Lst);
  69.                   Write('   ')
  70.                end;
  71.               With Directory[DirIndex[Loop]] do Write(Lst,'    ',Dname);
  72.               Loop1:=Loop1+1
  73.             end;
  74.            WriteLn(Lst,#10#10)
  75.       end
  76.      else
  77.       begin
  78.          Index:=WorkSpaceDirStart;
  79.          PageStart:=WorkSpaceDirStart;
  80.          Repeat
  81.            With Directory[DirIndex[WSpIndex]] do
  82.             begin
  83.                If auto then WriteLn(lst,DriveStr,':',Dname,#10)
  84.                else
  85.                 begin
  86.                    ClrScr;
  87.                    LowVideo;
  88.                    WriteLn('WorkSpace = ',Dname);
  89.                    NormVideo;
  90.                    Writeln('         TRACK = ',Dtrack,'  SECTOR = ',Dsector,' OFFSET = ',Doffset)
  91.                 end
  92.             end;
  93.            Select(PageStart,WorkSpaceDirStart,WorkSpaceDirEnd,Index,Response1);
  94.            Case Response1 of
  95.                 127:DeleteFile(Index);
  96.                 13 : DisplayWSpFile(WSpIndex,Index);
  97.            end;
  98.          until Response1=27 {ESC}
  99.   end
  100. end;
  101.  
  102. Procedure WorkSpacesDspChg;
  103.  
  104. Var WSpIndex,Response,PageStart:integer;
  105.  
  106. Begin
  107.   GetWSpaces;
  108.   WriteLn;
  109.   ShellSort(0,EndWSPDirPtr);
  110.   FillIndex(0,0,EndWSpDirPtr,WorkSpaceDirStart);
  111.   WSpIndex:=0;
  112.   PageStart:=0;
  113.   repeat
  114.      ClrScr;
  115.      LowVideo;Write('      WORKSPACES     ');
  116.      WriteLn(' ON  DRIVE = ',DriveStr);NormVideo;
  117.      If auto then begin
  118.            Writeln(#10'Please wait printing Work Space File names');
  119.            for WSpIndex:=0 to WorkSpaceDirStart-1 do
  120.            begin
  121.               WSPFilesDspChg(WSpIndex);
  122.               GotoXY(1,10);
  123.               Writeln( WSpIndex+1,' out of ',WorkSpaceDirStart,' Workspaces Completed');
  124.            end;
  125.            Response:=27
  126.      end
  127.      else Select(PageStart,0,WorkSpaceDirStart-1,WSpIndex,Response);
  128.      Case Response of
  129.          127: DeleteFile(WSpIndex);
  130.          13 : WSPFilesDspChg(WSpIndex);
  131.      end;
  132.   until Response=27; {ESC}
  133. end;
  134. Procedure testing;
  135. Var
  136.    count:integer;
  137.  
  138. Procedure test(var pos:byte);
  139.  
  140. Var
  141.   Buffer:sectorbuff absolute pos;
  142.  
  143. begin
  144.      DisplaySector(Buffer)
  145. end;
  146.  
  147. begin
  148.   For x:=0 to 3 do
  149.    begin
  150.      count:=x*128;
  151.      test(DMA[count]);
  152.      Delay(2000)
  153.    end
  154. end;      {****}
  155.  
  156. Begin
  157.   SavedDrive:=Mem[4];
  158.   CurDrive:=-1; {No data in DMA}
  159.   {Write('Default Drive = ',SavedDrive,
  160.         ' WarmStart= ',Mem[0],' ',Mem[1],' ',Mem[2]);Delay(1500);}{****}
  161.   Fillchar(DMA,128,0);
  162.   repeat
  163.      ClrScr;
  164.      Writeln('The Starnet Network Manager');
  165.      Writeln(#10,'    Authored by R.K.Hallworth');
  166.      Writeln(    '    of Donvale Christian School,Victoria');
  167.      Writeln(    '    This software is Public Domain');
  168.      WriteLn(    '       Version 1.1   Jan 1987'#10#10);
  169.      Write('Which Drive ( A ... E)  ? ');
  170.      Repeat
  171.         Read(Kbd,DriveStr);
  172.         DriveStr:=UpCase(DriveStr)
  173.      until DriveStr in ['A'..'E',#27];
  174.      If DriveStr=#27 then write('ESC');
  175.      If DriveStr<>#27
  176.         then begin
  177.                Writeln(DriveStr);
  178.                DriveSelected:= ord(DriveStr)-65;
  179.                GetDriveInfo(DriveSelected);
  180.                Write(#10,'Do you want a printout of all WorkSpace Contents ? (Y/N) ');
  181.                Repeat
  182.                    Read(Kbd,Ch);
  183.                    Ch:=UpCase(Ch)
  184.                Until Ch in ['Y','N'];
  185.                WriteLn(Ch);
  186.                Auto:= (Ch='Y');
  187.                WorkSpacesDspChg
  188.              end
  189.   until DriveStr=#27;
  190.   {testing;} {****}
  191.   GetDriveInfo(SavedDrive);
  192. end.
  193.