unit helper;
interface

   procedure help;

implementation

uses {$U kermglob.code} kermglob;

procedure keypress;

var ch: char;

  begin
    writeln('---------------Press any key to continue---------------');
    read( keyboard, ch );
    page(output); {SP}
  end; (* keypress *)

procedure help1;

  var ch: char;

  begin { help1 }
    if (noun = nullsym) then begin
      writeln('KERMIT is a family of  programs that do reliable file transfer');
      writeln('between computers over TTY lines.',
              '  KERMIT can also be used to make the ');
      writeln('microcomputer behave as a terminal',
              ' for a mainframe.  These are the ');
      writeln('commands for the UCSD p-system version, KERMIT-UCSD:');
      writeln
    end; (* if *)

    if (noun = nullsym) or (noun = consym) then begin
      writeln('  CONNECT     To make a "virutual terminal" connection to a remote');
      writeln(' ':14, 'system.');
      writeln;
      writeln(' ':14, 'To break the connection and "escape" back to the micro,');
      writeln(' ':14, 'type the escape sequence (CTRL-] C, that is Control ');
      writeln(' ':14, 'rightbracket followed immediately by the letter C.)');
      writeln;
    end; (* if *)

    if (noun = nullsym) or (noun = exitsym) then begin
      writeln('  EXIT        To return back to main command level of the p-system.');
      writeln;
    end; (* if *)

    if (noun = nullsym) or (noun = helpsym) then begin
      writeln('  HELP        To get a list of KERMIT commands.');
      writeln;
    end; (* if *)

    if (noun = nullsym) or (noun = quitsym) then begin
      writeln('  QUIT        Same as EXIT.');
      writeln;
    end; (* if *)

    if (noun = nullsym) or (noun = recsym) then begin
      writeln('  RECEIVE     To accept a file from the remote system.');
      writeln;
    end; (* if *)
  end; (* help1 *)

procedure help2;

var ch: char;

  begin { help2 }
    if (noun = nullsym) or (noun = sendsym) then begin
      writeln('  SEND        To send a file or group of files to the remote system.');
      writeln;
    end; (* if *)

    if (noun = nullsym) then
        keypress;
    if (noun = nullsym) or (noun = setsym) then begin
      writeln('  SET         To establish system-dependent parameters.  The ');
      writeln('              SET options are as follows: ');
      writeln;
      if (adj = nullsym) or (adj = debugsym) then begin
        writeln('              DEBUG            To set debug mode ON or OFF ');
        writeln(' ':31, '(default is OFF).');
        writeln;
      end; (* if *)
      if (adj = nullsym) or (adj = escsym) then begin
        writeln(' ':14, 'ESCAPE           To change the escape sequence that ');
        writeln(' ':31, 'lets you return to the PC Kermit from');
        writeln(' ':31, 'the remote host.  The default is CTRL-] c.');
        writeln;
      end; (* if *)
      if (adj = nullsym) or (adj = filewarnsym) then begin
        writeln(' ':14, 'FILE-WARNING     ON/OFF, default is OFF.  If ON, ');
        writeln(' ':31, 'Kermit will warn you and rename an ');
        writeln(' ':31, 'incoming file so as not to write over');
        writeln(' ':31, 'a file that currently exists with the');
        writeln(' ':31, 'same name');
        writeln;
      end; (* if *)
      if (adj = nullsym) or (adj = baudsym) then begin
        writeln(' ':14, 'BAUD             To set the serial baud rate.' );
        writeln(' ':31, 'Choices are: 110/300/1200/2400/4800/9600.' );
        writeln(' ':31, 'The default is 1200.');
        writeln
      end; (* if *)
      if (adj = nullsym) then
        keypress;
    end; (* if *)
  end; (* help2 *)

procedure help3;

  begin
    if (noun = nullsym) or (noun = setsym) then begin
      if (adj = nullsym) or (adj = ibmsym) then begin
        writeln(' ':14, 'IBM              ON/OFF, default is OFF.  This flag ');
        writeln(' ':31, 'should be ON only when transfering files');
        writeln(' ':31, 'between the micro and an IBM VM/CMS');
        writeln(' ':31, 'system.  It also causes the parity to');
        writeln(' ':31, 'be set appropriately (mark) and activates');
        writeln(' ':31, 'local echoing');
        writeln;
      end; (* if *)

      if (adj = nullsym) or (adj = localsym) then begin
        writeln(' ':14, 'LOCAL-ECHO       ON/OFF, default is OFF.  This sets the');
        writeln(' ':31, 'duplex.  It should be ON when using ');
        writeln(' ':31, 'the IBM and OFF for the DEC-20.');
        writeln;
      end; (* if *)

      if (adj = nullsym) or (adj = emulatesym) then begin
        writeln(' ':14, 'EMULATE          ON/OFF, default is OFF.  This sets the');
        writeln(' ':31, 'DataMedia 1520A terminal emulation on or off.');
        writeln;
      end; (* if *)
    end; (* if *)
  end; (* help3 *)

procedure help4;

  begin
    if (noun = setsym) or (noun = nullsym) then begin
      if (adj = nullsym) or (adj = paritysym) then begin
        writeln(' ':14, 'PARITY           EVEN, ODD, MARK, SPACE, or NONE.');
        writeln(' ':31, 'NONE is the default but if the IBM ');
        writeln(' ':31, 'flag is set, parity is set to MARK.  ');
        writeln(' ':31, 'This flag selects the parity for ');
        writeln(' ':31, 'outgoing and incoming characters during');
        writeln(' ':31, 'CONNECT and file transfer to match the');
        writeln(' ':31, 'requirements of the host.');
        writeln;
      end; (* if *)
    end; (* if *)
    if (noun = nullsym) or (noun = showsym) then begin
      writeln('  SHOW        To see the values of parameters that can be modified');
      writeln('              via the SET command.');
    end; (* if *)
  end; (* help4 *)

procedure help;
begin
  help1;
  help2;
  help3;
  help4
end; (* help *)

end. { unit helper }

