	SUBROUTINE VTPLOT(IX,IY,MODE)
C
C  J.C. PHILLIPS   SUNY/BNL   2/10/83
C
C  TO UTILISE RETROGRAPHICS CAPABILITIES OF THE VT100
C  TO PLOT INCOMING DATA.
C
	BYTE BUFFER(10),BOX(16)
	INTEGER IPARAM(6)
	DATA BOX /"40,"140,"40,"100,"64,"176,"40,"100,
     Q"64,"176,"77,"137,"40,"140,"77,"137/
	GOTO(10,20,20,20,20,10) MODE
C10	CALL GETADR(IPARAM(1),BUFFER(1))		! DRAW BOX
10	BUFFER(1)="33
	BUFFER(2)="14
	BUFFER(3)=' '
	BUFFER(4)="35
	IF(MODE.EQ.6) BUFFER(4)="30
	IPARAM(2)=4
        WRITE(5,142)(BUFFER(I),I=1,IPARAM(2))
142	FORMAT('$',80A1)
C	CALL QIO("410,5,1,,,IPARAM)
	IF(MODE.EQ.6) RETURN
	DO 1 I=1,13,4
C	CALL GETADR(IPARAM(1),BOX(I))
        WRITE(5,142)(BOX(K),K=I,I+IPARAM(2)-1)
C	CALL QIO("410,5,1,,,IPARAM)
1	CONTINUE
C	CALL GETADR(IPARAM(1),BOX(1))
C	CALL QIO("410,5,1,,,IPARAM)
        WRITE(5,142)(BOX(I),I=1,IPARAM(2))
20	BUFFER(4)=(IX/"40).OR."40
	BUFFER(5)=(IX.AND."37).OR."100
	BUFFER(2)=(IY/"40).OR."40
	BUFFER(3)=(IY.AND."37).OR."140
C	IF(MODE.NE.2) CALL GETADR(IPARAM(1),BUFFER(1))
C	IF(MODE.EQ.2) CALL GETADR(IPARAM(1),BUFFER(2))
	IPARAM(2)=6
	BUFFER(1)="35
	BUFFER(6)="37
	IF(MODE.EQ.2) IPARAM(2)=4
	IF(MODE.EQ.3) IPARAM(2)=5
        IF(MODE.NE.2) WRITE(5,142)(BUFFER(I),I=1,IPARAM(2))
	IF(MODE.EQ.2) WRITE(5,142)(BUFFER(I),I=2,1+IPARAM(2))
C	CALL QIO("410,5,1,,,IPARAM)
	RETURN
	END


