procedure write_bool(s: string255; b: boolean);

(* writes message & 'on' if b, 'off' if not b *)
  begin
    write(s);
    case b of
        true: writeln('on');
        false: writeln('off');
      end; (* case *)
  end; (* write_bool *)

procedure show_parms;

(* shows the various settable parameters *)

begin
   case noun of
      allsym: begin
                 write_bool('Debugging is ',debug);
                 writeln('Escape character is ^',ctl(esc_char));
                 write_bool('File warning is ',fwarn);
                 write_bool('IBM is ',ibm);
                 write_bool('Local echo is ',halfduplex);
                 write_bool('Emulate DataMedia is ', emulating );
                 case parity of
                    evenpar: write('Even');
                    markpar: write('Mark');
                    nopar: write('No');
                    oddpar: write('Odd');
                    spacepar: write('Space');
                 end; (* case *)
                 writeln(' parity');
                 writeln( 'Baud rate is ', baud:5 );
              end; (* allsym *)

      debugsym:    write_bool('Debugging is ',debug);

      escsym:      writeln('Escape character is ^',ctl(esc_char));

      filewarnsym: write_bool('File warning is ',fwarn);

      ibmsym:      write_bool('IBM is ',ibm);

      localsym:    write_bool('Local echo is ',halfduplex);

      emulatesym:  write_bool('Emulate DataMedia is ', emulating );

      baudsym:     writeln( 'Baud rate is ', baud:5 );

      paritysym:   begin
                      case parity of
                         evenpar: write('Even');
                         markpar: write('Mark');
                         nopar: write('No');
                         oddpar: write('Odd');
                         spacepar: write('Space');
                      end; (* case *)
                      writeln(' parity');
                      end; (* paritysym *)
                   end; (* case *)
end; (* show_sym *)


procedure set_parms;

(* sets the parameters *)

  begin
    case noun of
        debugsym: case adj of
                      onsym: begin
                          debug := true;
                          (*$I-*)
                          rewrite(debf,'CONSOLE:')
                          (*I+*)
                        end; (* onsym *)
                      offsym: debug := false
                    end; (* case adj *)
        escsym: escchar := newescchar;
        filewarnsym: fwarn := (adj = onsym);
        ibmsym: case adj of
                    onsym: begin
                        ibm := true;
                        parity := markpar;
                        half_duplex := true;
                        fillparityarray
                      end; (* onsym *)
                    offsym: begin
                        ibm := false;
                        parity := nopar;
                        half_duplex := false;
                        fillparityarray
                      end; (* onsym *)
                  end; (* case adj *)
        localsym: halfduplex := (adj = onsym);
        emulatesym: emulating := (adj = onsym);
        paritysym: begin
              case adj of
                  evensym: parity := evenpar;
                  marksym: parity := markpar;
                  nonesym: parity := nopar;
                  oddsym: parity := oddpar;
                  spacesym: parity := spacepar;
                end; (* case *)
              fill_parity_array;
             end; (* paritysym *)
        baudsym: begin
            if newbaud=110 then
               baud := 110
            else if newbaud=300 then
               baud := 300
            else if newbaud=1200 then
               baud := 1200
            else if newbaud=2400 then
               baud := 2400
            else if newbaud=4800 then
               baud := 4800
            else if newbaud=9600 then
               baud := 9600;
            setup_comm
         end { baudsym }
      end; (* case *)
  end; (* set_parms *)
