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 / CPM / TURBOPAS / TKERMIT.LBR / KHELP.PQS / KHELP.PAS
Pascal/Delphi Source File  |  2000-06-30  |  7KB  |  155 lines

  1.   procedure show; (* show the current parameters *)
  2.  
  3.     (* This procedure lists the current state of parameters for Kermit.
  4.        There is a little cleanup to do in this area, as some are for
  5.        future expansion and some will be implemented when a DEC-20 style
  6.        command parser is implemented.
  7.     *)
  8.  
  9.     begin (* show *)
  10.       writeln('Current state of parameters are:');
  11.       writeln;
  12.       writeln(tab(2), 'Filetype (Filetype): ', file_str[file_type_var],'.');
  13.       writeln(tab(2), 'Parity (PArity): ', parity_str[parity_type_var],'.');
  14.       writeln(tab(2), 'Port: (POrt):', port_str[port_type_var],'.');
  15.       writeln(tab(2), 'Escape sequence (constant): ^\ - C (Control-backslash ''C''.');
  16.       writeln(tab(2), 'Packet size (Size): ', packet_size,'.');
  17.       writeln(tab(2), 'Number of pad characters (Npad): ', npad,'.');
  18.       writeln(tab(2), 'Pad character to send (PAD): char(',pad,').');
  19.       writeln(tab(2), 'Check type (Checktype): ',chk_type,'.');
  20.       writeln(tab(2), 'Debug mode (Debug): ', debug_mode, '.');
  21.       writeln(tab(2), 'Number of retries: ', maxtry, '.');
  22.       writeln(tab(2), 'Printer mode (PRinter): ', print_mode, '.');
  23.       writeln;
  24.       writeln('To change a parameter, type: SET <parameter> <value>');
  25.       writeln('Valid parameters are shown in parentheses. Abbreviations are capitalized.');
  26.     end; (* show *)
  27.  
  28.  
  29.   procedure help;
  30.  
  31.     (* This procedure just lists the valid commands that can be typed on Turbo
  32.        Kermit.
  33.     *)
  34.  
  35.     begin
  36.       clrscr;
  37.       writeln('The following are valid commands:');
  38.       writeln(tab(5),'Bye - Logout host, return to CP/M.');
  39.       writeln(tab(5),'Connect - Connect to remote host and act as a terminal.');
  40.       writeln(tab(5),'Exit - Return to CP/M.');
  41.       writeln(tab(5),'Finish - Shut down remote server.');
  42.       writeln(tab(5),'Get - Get the specified file(s) from the host.');
  43.       writeln(tab(5),'Help - Display this help message.');
  44.       writeln(tab(5),'Quit - Return to CP/M.');
  45.       writeln(tab(5),'Receive - Receive a file from remote host.');
  46.       writeln(tab(5),'SENd - Send a file to remote host.');
  47.       writeln(tab(5),'SET - Set local Kermit parameter.');
  48.       writeln(tab(5),'SHow - Show the current parameters.');
  49.       writeln(tab(5),'Ctrl-D to abort transfer.');
  50.       writeln;
  51.       writeln(tab(3),'Allowable abbreviations are shown in capital letters.');
  52.     end;
  53.  
  54. (*----------------------------------------------------------------*)
  55.  
  56.   procedure set_param; (* set a prameter *)
  57.  
  58.     (* This procedure is several case statements that read the arguments
  59.        and try to adjust the parameters accordingly.  It will probably be
  60.        replaced at a later time with a DEC-20 style command parser, so not
  61.        much work will be done on it now to clean it up.
  62.     *)
  63.  
  64.     var
  65.       temp, code : integer;
  66.  
  67.     begin (* set_param *)
  68.       case arg1[1] of
  69.         'D', 'd' : begin
  70.                      if (arg2 = 'ON') or (arg2 = 'on') then
  71.                        begin
  72.                          debug := true;
  73.                          debug_mode := 'on';
  74.                        end
  75.                      else
  76.                        begin
  77.                          debug := false;
  78.                          debug_mode := 'off';
  79.                        end;
  80.                      writeln('Debug mode is now ', debug_mode);
  81.                    end;
  82.         'F', 'f' : begin
  83.                      case arg2[1] of
  84.                        'A', 'a' : file_type_var := ascii;
  85.                        'B', 'b' : file_type_var := binary;
  86.                        else
  87.                          writeln('Unknown file type.');
  88.                      end; (* case *)
  89.                      writeln('Filetype set to:  ', file_str[file_type_var]);
  90.                    end;
  91.         'P', 'p' : begin
  92.                      case arg1[2] of
  93.                        'A','a' : begin
  94.                                    case arg2[1] of
  95.                                      'N', 'n' : parity_type_var := no_parity;
  96.                                      'M', 'm' : parity_type_var := mark_parity;
  97.                                      'S', 's' : parity_type_var := space_parity;
  98.                                      'E', 'e' : parity_type_var := even_parity;
  99.                                      'O', 'o' : parity_type_var := odd_parity;
  100.                                      else
  101.                                      writeln('Parity type ', arg2, ' not allowed.');
  102.                                    end; (* case *)
  103.                                    writeln('Parity set to: ', parity_str[parity_type_var]);
  104.                                  end;
  105.                      'O','o' : begin
  106.                                  case arg2[1] of
  107.                                    'R', 'r' : begin
  108.                                                 port_type_var := comm;
  109.                                                 port := 2;
  110.                                                 port_iobyte :=
  111.                                                   (base_iobyte and $fc) or port;
  112.                                               end;
  113.                                    'U', 'u' : begin
  114.                                                 port_type_var := uc1;
  115.                                                 port := 3;
  116.                                                 port_iobyte := (base_iobyte
  117.                                                   and $fc) or port;
  118.                                               end;
  119.                                    else
  120.                                      writeln('Invalid port selection.');
  121.                                  end; (* case *)
  122.                                  writeln('Port set to ', port_str[port_type_var]);
  123.                                end;
  124.                      'R','r' : begin
  125.                                  if (arg2 = 'ON') or (arg2 = 'on') then
  126.                                    begin
  127.                                      printing := true;
  128.                                      print_mode := 'on';
  129.                                    end
  130.                                  else
  131.                                    begin
  132.                                      printing := false;
  133.                                      print_mode := 'off';
  134.                                    end;
  135.                                  writeln('Print logging is now ', print_mode);
  136.                                end;
  137.                      end; (* case *)
  138.                    end;
  139.         'R', 'r' : begin
  140.                      val(arg2, temp, code);
  141.                      if code <> 0 then
  142.                        writeln('Retry count ', arg2, ' not allowed.')
  143.                      else
  144.                        begin
  145.                          maxtry := temp;
  146.                          writeln('Retry count set to ', retry, '.');
  147.                        end;
  148.                    end;
  149.         else
  150.           begin
  151.             writeln('Parameter ', arg1, ' not allowed.');
  152.           end;
  153.       end; (* case *)
  154.     end; (* set_param *)
  155.