%N grtt01 %F $MIR/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_miriad/miriad/work/miriad-4.3.8/borrow/pgplot/drivers/ttdriv.f
%D PGPLOT Tektronix driver, draw line segment
%B
      SUBROUTINE GRTT01(ICHAN, MODE, I4014, LASTI, LASTJ, I0, J0,
     :         I1, J1, CBUF, LBUF)
      INTEGER   ICHAN, MODE, I4014, LASTI, LASTJ, I0, J0, I1, J1, LBUF
      CHARACTER CBUF*(*)

 This routine draws a line from (I0, J0) to (I1, J1).  If LASTI>=0
 assume that the cursor is at the position is at (LASTI, LASTJ).
 For this case, a minimum length move is done from (LASTI, LASTJ) to
 the nearer point.  Of course, if (LASTI, LASTJ) and the nearer point
 are the same, then no bytes of positioning data are generated and
 sent to the terminal.  If LASTI<0 then a move is done with the
 coordinate fully specified.  In both cases the line end point
 is specified using the fewest number of bytes allowed by the protocol.
 Upon return, LASTI,LASTJ will contain the current cursor position. 
 If I4014=0 then 10 bit (4010) coordinates are generated, for I4014=1,
 full 12 bit Tektronix (4014 and higher) coordinates are generated.
 Note:  The 'delete' character (127) can occur in LOY or EXTRA byte;
 it can be replaced by escape-? if desired.

 Arguments:
   ICHAN       (in)     : passed to GRTT02 if called.
   MODE        (in)     : passed to GRTT02 if called.
   I4014       (in)     : =0 generate 4010 coords, =1 generate 4014.
   LASTI,LASTJ (in/out) : current position
   I0, J0      (in/out) : device coordinates of the starting point.
   I1, J1      (in/out) : device coordinates of the end point.
   CBUF        (in/out) : buffer for instruction.
   LBUF        (in/out) : Number of valid characters in CBUF.

 1993-Feb-02 - Created from GRZS01 - [AFT]
