home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / PROUT.ZIP / PROUT.INC
Encoding:
Text File  |  1986-04-11  |  1.5 KB  |  44 lines

  1. {File: PROUT.INC
  2. created: 06/26/85
  3. adapted: from CHOUT.PAS, off Borland SIG Feb. 3, 1985
  4. revised: 07/01/85}
  5.  
  6. (*{$U+} *)          {* NOTE: delete this $U+ when use as an include file}
  7.  
  8. type
  9.     prmode_typ = (pr_init,pr_on,pr_off);
  10. var
  11.     conoutptr_orig,
  12.     lstoutptr_orig : integer;
  13.     toprint : boolean;         {indicates whether output to printer or not}
  14.  
  15. procedure prout(prmode:prmode_typ);
  16. begin
  17. {   writeln(Ord(prmode));}
  18.    case Ord(prmode) of
  19.      0: begin                            {initialize}
  20.            conoutptr_orig := conoutptr;
  21.            lstoutptr_orig := lstoutptr;
  22.  
  23.         end;
  24.      1: conoutptr := lstoutptr;          {send display --> printer}
  25.      2: conoutptr := conoutptr_orig;     {reroute display --> display}
  26.    else
  27.      writeln(' ERROR! Incorrect parameter to procedure PROut');
  28.    end; {case}
  29. end; {prout}
  30.  
  31. {remove the next line to enable testing of this module}
  32. (*
  33. begin
  34.    write('START: ConPtr=',Conoutptr,'/ LstPtr=',Lstoutptr,'/ HIT ENTER'); readln;
  35.    prout(pr_init);
  36.    writeln('ORIGINAL POINTERS: Con= ',conoutptr_orig:6,' / Lst= ',Lstoutptr_orig);
  37.    write('INITd: ConPtr=',Conoutptr,'/ LstPtr=',Lstoutptr,'/ HIT ENTER'); readln;
  38.    prout(pr_on);
  39.    write('Printer SET ON: ConPtr=',Conoutptr,'/ LstPtr=',Lstoutptr,'/ HIT ENTER'); readln;
  40.    prout(pr_off);
  41.    write('SET OFF: ConPtr=',Conoutptr,'/ LstPtr=',Lstoutptr,'/ HIT ENTER'); readln;
  42.    writeln('I am back on the display, right?');
  43. end.
  44. (**)