home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / dskutl / swp-ms10.ark / TRAMDF.IF6 < prev    next >
Text File  |  1989-09-27  |  20KB  |  604 lines

  1.  
  2. {* ------------------------------------------------------------------------- *}
  3. {*                    S E C O N D   L E V E L   M E N U S
  4. {* ------------------------------------------------------------------------- *}
  5.  
  6. procedure ExecuteEpilogue ;  forward ;
  7.  
  8. procedure SetDefaults ;
  9. {*
  10.  * Set the default values for the CP/M and MS-DOS drive names.  Upon
  11.  * exit, the MS-DOS drive is assigned and installed!
  12.  *}
  13. var
  14.    NewDate: DateStrings ;  { Today's date }
  15.    Code   :        Char ;  { Command character }
  16. const
  17.    OSName     : array[Oss]         of string[ 6] =
  18.                 ( 'CP/M', 'MS-DOS' ) ;
  19.    NameOfClass: array[FileClasses] of string[12] =
  20.                 ( 'Text file', 'Binary file', 'Ask per file' ) ;
  21.    YesNo      : array[Boolean]     of string[ 3] =
  22.                 ( ' No', 'Yes' ) ;
  23.  
  24.  procedure ReadByte( var SomeByte: Byte ) ;
  25.  {*
  26.   * Read the (new) value for one of the padding characters.
  27.   *}
  28.  var
  29.     NextChar: Char ;  { Next character read }
  30.  
  31.   procedure ReadNextCharacter ;
  32.   {*
  33.    * Read and process one nibble (a four-bit quantity).
  34.    *}
  35.   var
  36.      Found: Boolean ;  { Legal character entered }
  37.   begin
  38.      repeat
  39.        Read( Kbd, NextChar ) ;
  40.        NextChar:= UpCase( NextChar ) ;
  41.        Found:= (NextChar in ['0'..'9','A'..'F',^M]) ;
  42.        if not Found then
  43.          Write( ^G ) ;
  44.      until Found ;
  45.      Write( NextChar ) ;
  46.      if NextChar<>^M then
  47.       begin
  48.        SomeByte:= (SomeByte shl 4) + Ord(NextChar) ;
  49.        if NextChar<'A' then
  50.          SomeByte:= SomeByte - Ord('0')
  51.        else
  52.          SomeByte:= SomeByte - Ord('A') + 10 ;
  53.       end ;  { of if }
  54.   end ;  { of ReadNextCharacter }
  55.  
  56.  begin
  57.     Write( ^M^J'Enter hex character code : $' ) ;
  58.     SomeByte:= 0 ;
  59.     ReadNextCharacter ;
  60.     if NextChar<>^M then
  61.       ReadNextCharacter ;
  62.  end ;  { of ReadByte }
  63.  
  64.  procedure SetCpmOptions ;
  65.  var
  66.     Code: Char ;  { Command code }
  67.  begin
  68.     repeat
  69.       DisplayTitle( 'MS-DOS -> CP/M copy options' ) ;
  70.       DisplayMenuHead ;
  71.       WriteLn( ' <C>  Copy file attributes = ', YesNo[CopyCpmFileAttr] ) ;
  72.       WriteLn( ' <F>  File type            = ', NameOfClass[FileClass] ) ;
  73.       WriteLn( ' <T>  Text file pad char.  = $', Hex(CpmTxtFillChar,2) ) ;
  74.       WriteLn( ' <B>  Binary file pad char.= $', Hex(CpmBinFillChar,2) ) ;
  75.       DisplayMenuTail ;
  76.       ReadCommand( Code ) ;
  77.       case Code of
  78.         'B' : ReadByte( CpmBinFillChar ) ;
  79.         'C' : CopyCpmFileAttr:= not CopyCpmFileAttr ;
  80.         'F' : if FileClass=AskUser then
  81.                 FileClass:= TextFile
  82.               else
  83.                 FileClass:= Succ( FileClass ) ;
  84.         'Q' : ;
  85.         'T' : ReadByte( CpmTxtFillChar ) ;
  86.       else
  87.         IllegalCommand ;
  88.       end ;  { of cases }
  89.     until Code='Q' ;
  90.  end ;  { of SetCpmOptions }
  91.  
  92.  procedure SetMsdosOptions ;
  93.  var
  94.     Code: Char ;  { Command code }
  95.  begin
  96.     repeat
  97.       DisplayTitle( 'CP/M -> MS-DOS copy options' ) ;
  98.       DisplayMenuHead ;
  99.       WriteLn( ' <C>  Copy file attributes  = ', YesNo[CopyMsdosFileAttr] ) ;
  100.       WriteLn( ' <P>  Cluster pad character = $',    Hex(MsdosFillChar,2) ) ;
  101.       WriteLn( ' <F>  File type             = ',   NameOfClass[FileClass] ) ;
  102.       DisplayMenuTail ;
  103.       ReadCommand( Code ) ;
  104.       case Code of
  105.         'C' : CopyMsdosFileAttr:= not CopyMsdosFileAttr ;
  106.         'F' : if FileClass=AskUser then
  107.                 FileClass:= TextFile
  108.               else
  109.                 FileClass:= Succ( FileClass ) ;
  110.         'P' : ReadByte( MsdosFillChar ) ;
  111.         'Q' : ;
  112.       else
  113.         IllegalCommand ;
  114.       end ;  { of cases }
  115.     until Code='Q' ;
  116.  end ;  { of SetMsdosOptions }
  117.  
  118. begin
  119.    repeat
  120.      DisplayTitle( 'Set default values' ) ;
  121.      DisplayMenuHead ;
  122.      WriteLn( ' <C>  CP/M default drive/user     = ',
  123.                ExpandFileName(CpmDriveName,DU_Format):4 ) ;
  124.      WriteLn( ' <M>  MS-DOS drive                = ',
  125.                MsdosDriveName:3, ':' ) ;
  126.      WriteLn( ' <S>  Source drive                = ',
  127.                OSName[SourceOs] ) ;
  128.      WriteLn ;
  129.      WriteLn( ' <T>  Today''s date                = ', TodaysDate ) ;
  130.      WriteLn( ' <D>  Display disk parameters     >' ) ;
  131.      WriteLn( ' <A>  CP/M -> MS-DOS copy options >' ) ;
  132.      WriteLn( ' <B>  MS-DOS -> CP/M copy options >' ) ;
  133.      WriteLn ;
  134.      Write  ( ' <E>  Exit from program' ) ;
  135.      DisplayMenuTail ;
  136.      ReadCommand( Code ) ;
  137.      case Code of
  138.        'A' : SetMsdosOptions ;
  139.        'B' : SetCpmOptions ;
  140.        'C' : begin
  141.                WriteLn ;
  142.                SetCpmDrive ;
  143.              end ;  { of case C }
  144.        'D' : DisplayMsdosDiskParameters ;
  145.        'E' : begin
  146.                ExecuteEpilogue ;     { Clean up BIOS tables }
  147.                UnInitFileNameUnit ;  { Remove BDOS shell }
  148.                Halt ;
  149.              end ;  { of case E }
  150.        'M' : begin
  151.                WriteLn ;
  152.                SetMsdosDrive ;
  153.              end ;  { of case M }
  154.        'Q' : if MsdosDriveName='?' then
  155.               begin
  156.                FlagError( 'SetD: MS-DOS drive unspecified' ) ;
  157.                Code:=  '?' ;  { Inhibit termination of the loop }
  158.               end ;  { of case Q }
  159.        'S' : if SourceOS=Cpm then
  160.               begin
  161.                SourceOS     := Msdos ;
  162.                DestinationOS:=   Cpm ;
  163.               end
  164.              else  { if SourceOS=Msdos then }
  165.               begin
  166.                SourceOS     :=   Cpm ;
  167.                DestinationOS:= Msdos ;
  168.               end ;  { of if/case 'X' }
  169.        'T' : begin
  170.                WriteLn ;
  171.                Write( 'Enter date [yyyymmdd] : ' ) ;
  172.                ReadLn( NewDate ) ;
  173.                SetTodaysDate( NewDate ) ;
  174.              end ;  { of case 'T' }
  175.      else
  176.        IllegalCommand ;
  177.      end ;  { of case }
  178.      ReportError ;
  179.    until Code='Q' ;
  180. end ;  { of SetDefaults }
  181.  
  182. procedure EnterFileManager ;
  183. {*
  184.  * Enter a line-oriented filemanager a la SWEEP.  For a proper operation of
  185.  * this procedure, the MS-DOS drive should be assigned (set). In other words,
  186.  * the MsdosDriveName should not be '?'.
  187.  *}
  188. type
  189.    PathNames   = string[40] ;  { Description of path to source/destination }
  190.    CommandCodes=   ' '..'~' ;  { Set of possible command codes }
  191. var
  192.    AllowedCommands:     set of CommandCodes ;  { Currently allowed commands }
  193.    PathName       : array[OSs] of PathNames ;  { Cpm & Msdos paths }
  194.  
  195.    NewHeader: Boolean ;  { Display screen header (again) }
  196.    NewLine  : Boolean ;  { Display file entry on a new line }
  197.    Code     :    Char ;  { Command code }
  198.    I        : Integer ;  { Loop control variable }
  199.  
  200.  procedure AskFileClass ;
  201.  begin
  202.     if ReadYesNoAnswer( 'Text file' )='Y' then
  203.       FileClass:= TextFile
  204.     else
  205.       FileClass:= BinaryFile ;
  206.  end ;  { of AskFileClass }
  207.  
  208.  procedure DeleteFile( OS: OSs ) ;
  209.  begin
  210.     if OS=Cpm then  DeleteCpmFile
  211.               else  DeleteMsdosFile ;
  212.  end ;  { of DeleteFile }
  213.  
  214.  function GetFreeSpace( OS: OSs ) : Integer ;
  215.  begin
  216.     if OS=CPm then GetFreeSpace:= GetCpmFreeSpace
  217.               else GetFreeSpace:= GetMsdosFreeSpace ;
  218.  end ;  { of GetFreeSpace }
  219.  
  220.  function LocateFile( OS: OSs ) : Boolean ;
  221.  begin
  222.     if OS=Cpm then  LocateFile:= LocateCpmFile
  223.               else  LocateFile:= LocateMsdosFile ;
  224.  end ;  { of LocateFile }
  225.  
  226.  procedure ChangeMsdosPath ;
  227.  {*
  228.   * Change the MS-DOS path to the directory associated with the current
  229.   * file entry.
  230.   *}
  231.  type
  232.     NameString= string[11] ;  { String to contain file name }
  233.  var
  234.     SubDirName: NameString ;  { Name of (sub)directory }
  235.  
  236.   function Trim( SomeString: NameString ) : NameString ;
  237.   {*
  238.    * Remove the trailing spaces from a name.
  239.    *}
  240.   begin
  241.      while (Length(SomeString)>0) and (SomeString[Length(SomeString)]=' ') do
  242.        Delete( SomeString, Length(SomeString), 1 ) ;
  243.      Trim:= SomeString ;
  244.   end ;  { of Trim }
  245.  
  246.  begin
  247.     if LocateMsdosDirectory then
  248.      begin
  249.  {*
  250.   * Save the number of the first cluster containing the FCB's of this
  251.   * (sub)directory.  A zero value indicates the root directory.  Note that
  252.   * the other Directory... variables are set at the initialisation of a
  253.   * new search through the (sub)directory.
  254.   *}
  255.       DirectoryStartCls:= MsdosFcb^.Cluster ;
  256.   {*
  257.    * Update the name of the path to the current directory.
  258.    *}
  259.       SubDirName:= Trim( MsdosFcb^.FileName ) ;
  260.       if SubDirName='.' then
  261.         { do nothing }
  262.       else
  263.         if SubDirName='..' then
  264.           DirectoryNesting:= Pred( DirectoryNesting )
  265.         else
  266.          begin
  267.           DirectoryNesting:= Succ( DirectoryNesting ) ;
  268.           if DirectoryNesting<=MsdosPathSize then
  269.             MsdosPath[DirectoryNesting]:= SubDirName + '\' ;
  270.          end  { of else/else }
  271.      end
  272.     else
  273.       FlagError( 'ChaMP: Can''t find directory ' + FileEntry^.Name ) ;
  274.  end ;  { of ChangeMsdosPath }
  275.  
  276.  procedure CopyFile ;
  277.  {*
  278.   * Copy one file from the source disk to the destination disk.
  279.   *}
  280.  var
  281.     OrigFileClass: FileClasses ; { Original file class }
  282.  begin
  283.     if not IsFile then
  284.      begin
  285.       Write( 'Can''t copy it.' ) ;
  286.       Exit ;
  287.      end ;  { of if }
  288.  {*
  289.   * Check if a file of that name already exeists on the destination disk.  If
  290.   * so, ask the user if that file can be destroyed.  If not, exit immediatly.
  291.   *}
  292.     if LocateFile( DestinationOS ) then
  293.       if not ErrorDetected then
  294.         if ReadYesNoAnswer( 'Overwrite file' )='Y' then
  295.           DeleteFile( DestinationOS )
  296.         else
  297.           Exit ;
  298.  {*
  299.   * See if there is enough room on the destination disk to copy the file.
  300.   *}
  301.     if not ErrorDetected then
  302.       if FileEntry^.Size>GetFreeSpace(DestinationOS) then
  303.         FlagError( ^H': Not enough space on destination disk' ) ;
  304.  {*
  305.   * Determine the type if file.  This information is needed either to 
  306.   * determine the real end-of-file position (copy to MS-DOS) or to determine
  307.   * padding of the last record (copy to CP/M).
  308.   *}
  309.     if not ErrorDetected then
  310.      begin
  311.       OrigFileClass:= FileClass ;
  312.       if FileClass=AskUser then  AskFileClass ;
  313.  
  314.       if SourceOS=Cpm then  WriteMsdosFile   { Finally, go copy the file }
  315.                       else  ReadMsdosFile ;
  316.  
  317.       FileClass:= OrigFileClass ;
  318.      end ;  { of if }
  319.  
  320.     if not ErrorDetected then
  321.       Write( 'Done.' )
  322.     else
  323.       BuildErrorTrace( 'CopF_' ) ;
  324.  end ;  { of CopyFile }
  325.  
  326.  procedure CopyTaggedFiles ;
  327.  {*
  328.   * Copy all the tagged files to the destination disk.
  329.   *}
  330.  begin
  331.     FileEntry:= HeadFileList ;
  332.     while FileEntry<>TailFileList do
  333.      begin
  334.       if FileEntry^.Mark then
  335.        begin
  336.         WriteLn ;
  337.         Write  ( 'Copying  --> ', GetFileEntryName, ' : ' ) ;
  338.         CopyFile ;
  339.         if ErrorDetected then
  340.          begin
  341.           ReportError ;
  342.           FileEntry:= TailFileList^.Prev ;  { Terminate while loop }
  343.          end
  344.         else  { if there is no error detected }
  345.          begin
  346.           FileEntry^.Mark:= False ;
  347.           SizeTaggedFiles:= SizeTaggedFiles - FileEntry^.Size ;
  348.          end ;  { of else }
  349.        end ;  { of if }
  350.       FileEntry:= FileEntry^.Next ;
  351.      end ;  { of while }
  352.  
  353.     FileEntry:= HeadFileList ;
  354.     FileIndex:=            1 ;
  355.  end ;  { of CopyTaggedFiles }
  356.  
  357.  procedure DisplayFreeSpace ;
  358.  {*
  359.   * Display the free disk space on both the CP/M and the MS-DOS disk.
  360.   *}
  361.  begin
  362.     WriteLn ;
  363.     WriteLn( 'Free disk space on CP/M   drive ', ExtractDisk(CpmDriveName),
  364.              ': is ', GetCpmFreeSpace:4, ' KByte.' ) ;
  365.     WriteLn( 'Free disk space on MS-DOS drive ', MsdosDriveName,
  366.              ': is ', GetMsdosFreeSpace:4, ' KByte.' ) ;
  367.  end ;  { of displayFreeSpace }
  368.  
  369.  procedure DisplayHelp ;
  370.  {*
  371.   * Display a short summary of all the supported filemanager commands.
  372.   *}
  373.  begin
  374.     WriteLn ;  WriteLn ;
  375.     WriteLn( ' < >  Advance one file     | <P>  Change MS-DOS path' ) ;
  376.     WriteLn( ' <B>  Back one file        | <Q>  Quit' ) ;
  377.     WriteLn( ' <C>  Copy file            | <S>  Select MS-DOS drive' ) ;
  378.     WriteLn( ' <D>  Delete file          | <T>  Tag file' ) ;
  379.     WriteLn( ' <E>  Erase tagged files   | <U>  Untag file' ) ;
  380.     WriteLn( ' <F>  Show free disk space | <W>  Wildcard tag' ) ;
  381.     WriteLn( ' <L>  Login CP/M drive     | <X>  Swap CP/M <-> MS-DOS' ) ;
  382.     WriteLn( ' <M>  Copy tagged files    | <Z>  Set defaults' ) ;
  383.     WriteLn ;
  384.  end ;  { of DisplayHelp }
  385.  
  386.  procedure EraseFile ;
  387.  {*
  388.   * Erase (delete) the file associated with current filelist entry and
  389.   * change the filelist to reflect this modification.
  390.   *}
  391.  begin  { of EraseFile }
  392.  {*
  393.   * Only a file can be deleted.  Exit if the entry is not a file.
  394.   *}
  395.     if not IsFile then
  396.      begin
  397.       Write( 'Can''t delete it.' ) ;
  398.       Exit ;
  399.      end ;  { of if }
  400.  
  401.     if ReadYesNoAnswer( 'Delete' )='Y' then
  402.      begin
  403.       DeleteFile( SourceOS ) ;
  404.       DeleteFileEntry ;         { Adjusts SizeTaggedFiles too! }
  405.      end
  406.     else  { do not delete this file after all }
  407.  {*
  408.   * Advance to the next file in the list.  Thus, upon exit of this procedure,
  409.   * the 'current' file entry is ALWAYS advanced, whether or not the file has
  410.   * been deleted.  The procedure EraseTaggedFiles needs this behaviour!  Note
  411.   * that only FILES can be tagged, thus if the 'IsFile' test at the beginning
  412.   * of this procedure is negative, there is no need to advance to the next
  413.   * file entry.
  414.   *}
  415.       AdvanceFileEntry ;
  416.  end ;  { of EraseFile }
  417.  
  418.  procedure EraseTaggedFiles ;
  419.  {*
  420.   * Erase (delete) all the tagged files.  For each file the user must
  421.   * acknowledge that the file must be deleted.
  422.   *}
  423.  begin
  424.     FileEntry:= HeadFileList ;
  425.     while FileEntry<>TailFileList do
  426.      begin
  427.       if FileEntry^.Mark then
  428.        begin
  429.         WriteLn ;
  430.         Write  ( 'Deleting --> ', GetFileEntryName, ' : ' ) ;
  431.         EraseFile ;
  432.        end
  433.       else { the file entry is not marked }
  434.         FileEntry:= FileEntry^.Next ;
  435.      end ;  { of while }
  436.     FileEntry:= HeadFileList ;
  437.     FileIndex:=            1 ;
  438.  end ;  { of EraseTaggedFiles }
  439.  
  440. begin  { of EnterFileManager }
  441. {*
  442.  * Preset the control variables and build a file list from the directory on
  443.  * the source drive.  If an error is detected while reading the directory,
  444.  * exit from the file manager.
  445.  *}
  446.    if SourceOS=Cpm then  ReadCpmDirectory
  447.                    else  ReadMsdosDirectory ;
  448.    if ErrorDetected then
  449.     begin
  450.      ReportError ;
  451.      Exit ;
  452.     end ;  { of if }
  453.  
  454. (*   SetWindow( 5, 24 ) ;  { Define window for file manager } *)
  455. (*   EnableWindow ; *)
  456.    NewHeader:= True ;
  457.    NewLine  := True ;
  458.    repeat
  459.      CpmCurrentDrive:= Bdos( GetCurrentDrive ) ;
  460. {*
  461.  * Display the header every time the CP/M drive/user selection or the MS-DOS
  462.  * drive selection has changed.  The header identifies the source and the
  463.  * destination of any copy command.  Note that in one of the WriteLn's the
  464.  * assumption is hidden that the line width is 80 characters.
  465.  *}
  466.      if NewHeader then
  467.       begin
  468.        DisplayTitle( 'File Manager' ) ;
  469.        PathName[Cpm  ]:= 'CP/M, ' +
  470.                          ExpandFileName( CpmDriveName, DU_Format) ;
  471.        PathName[Msdos]:= 'MS-DOS, ' + MsdosDriveName + ':' ;
  472.        I:= 0 ;
  473.        repeat
  474.          PathName[Msdos]:= PathName[Msdos] + MsdosPath[I] ;
  475.          I:= Succ( I ) ;
  476.        until (I>DirectoryNesting) or (I>MsdosPathSize) ;
  477.  
  478.        WriteLn( 'Source = ', PathName[SourceOS],
  479.                 ' ':55-Length(PathName[Cpm])-Length(PathName[Msdos]),
  480.                 ' Destination = ', PathName[DestinationOS] ) ;
  481.        NewHeader:= False ;
  482.       end ;  { of if }
  483. {*
  484.  * Determine the set of allowed commands.  If the filelist is empty, the file
  485.  * operations are not allowed (as they are not sensible).
  486.  *}
  487.      AllowedCommands:=[' ','.','?','B','C','D','E','F', { All command codes }
  488.                        'L','M','P','Q','S','T','U','W','X','Z'] ;
  489.      if SizeFileList=0 then
  490.       begin
  491.        AllowedCommands:= ['?','F','L','Q','S','X','Z'] ;
  492.        if NewLine then
  493.          Write( ^M^J'No files. ' ) ;
  494.        NewLine:= False ;
  495.       end ;  { of if }
  496. {*
  497.  * Display the current file entry.  Only in case of an erroneous command,
  498.  * the file entry is not re-displayed.
  499.  *}
  500.      if NewLine then
  501.        DisplayFileEntry ;
  502.      NewLine:= True ;
  503. {*
  504.  * Read the next command for the file manager from the keyboard device.  All
  505.  * non-printable characters are mapped onto the dot to make it visible.
  506.  *}
  507.      Read ( Kbd, Code ) ;
  508.      if not (Code in [' '..'~']) then
  509.        Code:= '.' ;
  510.      Write( Code, ' ' ) ;
  511.      Code:= UpCase( Code ) ;
  512.      if Code in AllowedCommands then
  513. {*
  514.  * Process the next file manager command.
  515.  *}
  516.        case Code of
  517.          ' ',
  518.          '.' : AdvanceFileEntry ;
  519.          '?' : DisplayHelp ;
  520.          'B' : BackupFileEntry ;
  521.          'C' : CopyFile ;
  522.          'D' : EraseFile ;
  523.          'E' : EraseTaggedFiles ;
  524.          'F' : DisplayFreeSpace ;
  525.          'L' : begin
  526.                  SetCpmDrive ;
  527.                  if SourceOS=Cpm then
  528.                    ReadCpmDirectory ;
  529.                  NewHeader:= True ;
  530.                end ;  { of case 'L' }
  531.          'M' : CopyTaggedFiles ;
  532.          'P' : begin
  533.                  if IsDirectory { and SourceOS=Msdos } then
  534.                   begin
  535.                    ChangeMsdosPath ;
  536.                    ReadMsdosDirectory ;
  537.                    NewHeader:= True ;
  538.                   end   { of if }
  539.                  else
  540.                   begin
  541.                    Write( ^G^H^H' '^H ) ;
  542.                    NewLine:= False ;
  543.                   end ;  { of else }
  544.                end ;  { of case 'P' }
  545.          'Q' : ;
  546.          'S' : begin
  547.                  SetMsdosDrive ;
  548.                  if (SourceOS=Msdos) and (MsdosDriveName<>'?') then
  549.                    ReadMsdosDirectory ;
  550.                  NewHeader:= True ;
  551.                end ;  { of case 'S' }
  552.          'T' : begin
  553.                  TagFileEntry ;
  554.                  AdvanceFileEntry ;
  555.                end ;  { of case 'T' }
  556.          'U' : begin
  557.                  UntagFileEntry ;
  558.                  AdvanceFileEntry ;
  559.                end ;  { of case 'U' }
  560.          'W' : TagMultipleFileEntries ;
  561.          'X' : if SourceOS=Cpm then
  562.                 begin
  563.                  NewHeader    :=  True ;
  564.                  SourceOS     := Msdos ;
  565.                  DestinationOS:=   Cpm ;
  566.                  ReadMsdosDirectory ;
  567.                 end
  568.                else  { if SourceOS=Msdos then }
  569.                 begin
  570.                  NewHeader    :=  True ;
  571.                  SourceOS     :=   Cpm ;
  572.                  DestinationOS:= Msdos ;
  573.                  ReadCpmDirectory ;
  574.                 end ;  { of if/case 'X' }
  575.          'Z' : begin
  576.                  SetDefaults ;
  577.                  Newheader:= True ;
  578.                end ;  { of case 'Z' }
  579.        end  { of cases }
  580. {*
  581.  * The command code is not supported or perhaps not allowed just now.  Give
  582.  * an audible error indication and wipe-out the command code on the screen.
  583.  *}
  584.      else
  585.       begin
  586.        Write( ^G^H^H' '^H ) ;  { Remove illegal command code }
  587.        NewLine:= False ;       { Do not write a next line }
  588.       end ;  { of else }
  589.      ReportError ;
  590. {*
  591.  * If the command to select another MS-DOS drive failed, indicated by a '?'
  592.  * for the name, the user MUST select another drive, until it succeeds.
  593.  *}
  594.      if MsdosDriveName='?' then
  595.       begin
  596.        SetDefaults ;  { Force selection of another MS-DOS drive }
  597.        NewHeader:= True ;
  598.       end ;  { of if }
  599.    until Code='Q' ;
  600.  
  601. (*   DisableWindow ; *)
  602. end ;  { of EnterFileManager }
  603.  
  604.