program setprt;

{ menu driven okidata 92 setup utility }
{ author: bob scott    date: dec 85 }

const  {len: is the length of the control seqs (one or two bytes)}
       {control: is the actual control sequences}

  len : array [0..9] of integer = (1,2,2,2,2,1,1,1,1,1) ;

  control : array [0..9,1..2] of integer =
            ( (0,0),(27,48),(27,49),(27,54),(27,56),(30,0),(28,0),
              (29,0),(12,0),(24,0) );

var
  selection, out, i, lim, code : integer;
  user_input : string [1];

procedure print_menu;
  begin
    clrscr;
    writeln ('    OKIDATA PRINT CONTROL UTILITY');
    writeln ('             Bob Scott           ');
    writeln ;
    writeln ('0  (or RETURN) Exit program');
    writeln;
    writeln ('1  Draft mode');
    writeln ('2  NLQ mode');
    writeln ('3  6 lines per inch');
    writeln ('4  8 lines per inch');
    writeln ('5  10 CPI');
    writeln ('6  12 CPI');
    writeln ('7  17 CPI');
    writeln ('8  Top of form');
    writeln ('9  Clear printer');
    writeln;
    lowvideo;
    write (con,'Input selection:');
    normvideo;
  end;

begin
     print_menu;

     repeat

       repeat
           read (kbd,user_input);

           if length (user_input) = 0 then user_input := '0';

           val (user_input,selection,code);
       until code=0;

       lim := len[selection];

       for i:=1 to lim do
         begin
           out:=control[selection, i];
           write (lst,chr(out));
         end;

         write (con,'[',selection,'] ');

     until selection=0;

     clrscr;


end.
