home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / FX_SET.ZIP / FX-SET.PAS
Encoding:
Pascal/Delphi Source File  |  1987-11-08  |  6.7 KB  |  200 lines

  1.  
  2. program FX80;
  3.  
  4. {   This program will control most of the frequently used -- and
  5.  also some infrequently used -- configuration parameters for the
  6.  Epson FX80.  The code compiles 'as is' using TURBO Pascal.  Feel
  7.  free to modify it in any way.  A nice project might be a font
  8.  creation routine.  Please get word to me concerning any changes.
  9.  I'd like to see them.  Go to it!
  10.  
  11.                                   Mark Davis
  12.                                   2315 Mtn Oaks Cir
  13.                                   Birmingham, AL  35226
  14.  
  15.  }
  16. { Modified slightly -- to accept generic Epson commands,
  17.   since the RX-80, etc will not respond to the "!" command strings
  18.   which work with the FX-80.  Also minor screen changes, including
  19.   ClrScr at entry and exit.  Renamed "FXRX80.PAS"
  20.  
  21.                                    5/31/85
  22.                                    Phil Wheeler
  23.                                    5539 Towers St
  24.                                    Torrance, CA 90503
  25.  
  26. }
  27. { Modified to send LineFeed and FormFeeds and to trap errors caused
  28.   by input of integers outside the range specified in the case
  29.   statement.  Added some FX only commands to turn on Compressed-Elite,
  30.   near letter quality, reset to default type without changing
  31.   other printer settings, turn underline on and off, turn paper
  32.   out sensor on and off, and select sub/superscript.  An on screen
  33.   reminder has been added that codes may be combined to produce
  34.   special type faces (i.e., "Tiny Type" may be selected by combining
  35.   subscript, compressed and elite types).  Renamed "FX-SET.PAS"
  36.  
  37.                                    9/18/87
  38.                                    Jim Connolly
  39.                                    4922 Palo Alto SE
  40.                                    Albuquerque, NM 87108
  41.  
  42. }
  43. type
  44.    Command_type = string[3];
  45.    Prompt_type  = string[38];
  46. var
  47.    Input  : byte;
  48.    Exit   : boolean;
  49.    Esc    : char;
  50.    Command: Command_type;
  51.  
  52. procedure Give_printer(Command: Command_type);
  53.  
  54. {    Sends a string of up to 3 chars to printer }
  55.  
  56.           begin
  57.              if (Command = chr(12)) or (Command = chr(10)) then
  58.                write(Lst,Command)
  59.              else
  60.              write(Lst, Esc, Command);
  61.           end;
  62.  
  63. function Get_parm(Prompt: Prompt_type): integer;
  64.  
  65. {    Returns an integer taken after prompt
  66.      for keyboard input.
  67. }
  68.  
  69. var  parm: integer;
  70.  
  71.          begin
  72.             gotoXY(40,24);
  73.             write(Copy(Prompt,1,Length(Prompt)));
  74.             readln(parm);
  75.             Get_parm := parm;
  76.             gotoXY(40,24);
  77.             ClrEol;
  78.          end;
  79.  
  80. procedure Scrn_put(X,Y:integer; text:Prompt_type);
  81.  
  82. {    Put a menu line on the screen at X,Y     }
  83.  
  84.          begin
  85.             gotoXY(X,Y);
  86.             writeln(Copy(text,1,Length(text)));
  87.          end;
  88.  
  89. begin
  90.      ClrScr;
  91.      Esc := chr(27);
  92.      textcolor(Green);
  93.      textbackground(Black);
  94.      Scrn_put(24,1,'EPSON FX SETUP PROGRAM');
  95.      textcolor(LightGray);
  96.      Scrn_put(5,2,' 0 - RESET');
  97.      Scrn_put(5,3,' 1 - Elite ON');
  98.      Scrn_put(5,4,' 2 - Elite OFF');
  99.      Scrn_put(5,5,' 3 - Compressed ON');
  100.      Scrn_put(5,6,' 4 - Compressed OFF');
  101.      Scrn_put(5,7,' 5 - Expanded type ON');
  102.      Scrn_put(5,8,' 6 - Expanded type OFF');
  103.      Scrn_put(5,9,' 7 - Emphasized ON');
  104.      Scrn_put(5,10,' 8 - Emphasized OFF');
  105.      Scrn_put(5,11,' 9 - Double-strike ON');
  106.      Scrn_put(5,12,'10 - Double-strike OFF');
  107.      Scrn_put(5,13,'11 - Italics ON');
  108.      Scrn_put(5,14,'12 - Italics OFF');
  109.      Scrn_put(5,15,'13 - Near-Letter-Quality ON');
  110.      Scrn_put(5,16,'14 - Near-Letter-Quality OFF');
  111.      Scrn_put(5,17,'15 - Elite-Compressed Type');
  112.      Scrn_put(5,18,'16 - Reset to Default Type');
  113.      Scrn_put(5,19,'17 - Subscript ON');
  114.      Scrn_put(5,20,'18 - Superscript ON');
  115.      Scrn_put(40,2,'19 - Cancel Sub/Superscript');
  116.      Scrn_put(40,3,'20 - Proportional mode ON');
  117.      Scrn_put(40,4,'21 - Proportional mode OFF');
  118.      Scrn_put(40,5,'22 - Underline ON');
  119.      Scrn_put(40,6,'23 - Underline OFF');
  120.      Scrn_put(40,7,'24 - Paper out sensor OFF');
  121.      Scrn_put(40,8,'25 - Paper out sensor ON');
  122.      Scrn_put(40,9,'26 - Set left margin');
  123.      Scrn_put(40,10,'27 - Set right margin');
  124.      Scrn_put(40,11,'28 - Set form length');
  125.      Scrn_put(40,12,'29 - Skip over perf ON');
  126.      Scrn_put(40,13,'30 - Skip over perf OFF');
  127.      Scrn_put(40,14,'31 - n/72 line spacing');
  128.      Scrn_put(40,15,'32 - n/216 line spacing');
  129.      Scrn_put(40,16,'33 - 1/8 line spacing');
  130.      Scrn_put(40,17,'34 - 1/6 line spacing (standard)');
  131.      Scrn_put(40,18,'35 - Advance to Top of Form');
  132.      Scrn_put(40,19,'36 - Advance 1 Line');
  133.      textcolor(Green);
  134.      Scrn_put(20,21,'Combine options with multiple entries.');
  135.      Scrn_put(28,22,'99 - EXIT TO DOS');
  136.      textcolor(LightGray);
  137.      Exit := false;
  138.      repeat
  139.      begin
  140.           gotoXY(10,24);
  141.           write('Select option by number: ');
  142.           ClrEol;
  143.           read(Input);
  144.  
  145.           {  parse Input and select output string  }
  146.  
  147.           case Input of
  148.  
  149.               0 : Command := '@';
  150.               1 : Command := 'M';
  151.               2 : Command := 'P';
  152.               3 : Command := chr(15);
  153.               4 : Command := chr(18);
  154.               5 : Command := 'W1';
  155.               6 : Command := 'W0';
  156.               7 : Command := 'E';
  157.               8 : Command := 'F';
  158.               9 : Command := 'G';
  159.              10 : Command := 'H';
  160.              11 : Command := '4';
  161.              12 : Command := '5';
  162.              13 : Command := 'x'+'1';
  163.              14 : Command := 'x'+'0';
  164.              15 : Command := #15+ESC+#13;
  165.              16 : Command := 'P';
  166.              17 : Command := 'S1';
  167.              18 : Command := 'S0';
  168.              19 : Command := 'T';
  169.              20 : Command := 'p1';
  170.              21 : Command := 'p0';
  171.              22 : Command := '-1';
  172.              23 : Command := '-0';
  173.              24 : Command := '8';
  174.              25 : Command := '9';
  175.              26 : Command := 'l'+chr(get_parm('left margin at: '));
  176.              27 : Command := 'Q'+chr(get_parm('right margin at: '));
  177.              28 : Command := 'C'+chr(get_parm('form length: '));
  178.              29 : Command := 'N'+chr(get_parm('number of lines: '));
  179.              30 : Command := 'O';
  180.              31 : Command := 'A'+chr(get_parm('n/72 spacing, n = '));
  181.              32 : Command := '3'+chr(get_parm('n/216 spacing, n = '));
  182.              33 : Command := '0';
  183.              34 : Command := '2';
  184.              35 : Command := chr(12);
  185.              36 : Command := chr(10);
  186.              99 : Exit := True;
  187.           else
  188.              Command := chr(7);
  189.  
  190.           end; {case}
  191.  
  192.      if not Exit then Give_printer(Command);
  193.  
  194.      end; {until}
  195.  
  196.    until Exit;
  197.    ClrScr;
  198.  
  199. end.
  200.