     	SUBROUTINE IFPLOT( XOP, YOP, IPF )
C
C   PROGRAMMER: R.S. ZHOU,  8/1988
C
C	THIS ROUTINE GENERATES VECTORS IN ACTIVE LINE TYPE.
C
C    	IPF =  2: DRAW TO (XOP,YOP)
C	IPF =  3: MOVE TO (XOP,YOP)
C	IPF = -3: MOVE TO (XOP,YOP) AND REORIGIN
C	IPF = -9: REORIGIN TO (XOP,YOP) ONLY
C
     	INCLUDE 'HP7550.CBS'

     	XPS = XOP
     	YPS = YOP
     	IF( IFP.NE.0 .AND. IPF.GT.0 ) THEN
     	    CALL IFFILL_VERTEX( XPS, YPS, IPF )
     	ELSE IF( LTY.EQ.1 .OR. IPF.NE.2 ) THEN
     		 CALL IFDRAW( XPS, YPS, IPF )
     	ELSE IF( LTY.EQ.2 ) THEN
     		 CALL IFDRAW_DASH1( XPS, YPS )
     	ELSE IF( LTY.EQ.3 ) THEN
     		 CALL IFDRAW_DASH2( XPS, YPS )
     	ELSE IF( LTY.EQ.4 ) THEN
     		 CALL IFDRAW_DASH3( XPS, YPS )
     	ELSE IF( LTY.EQ.5 ) THEN
     		 CALL IFDRAW_DASH4( XPS, YPS )
     	ELSE IF( LTY.EQ.6 ) THEN
     		 CALL IFDRAW_DASH5( XPS, YPS )
     	ELSE IF( LTY.EQ.7 ) THEN
     		 CALL IFDRAW_DASH6( XPS, YPS )
     	ELSE IF( LTY.EQ.8 ) THEN
     		 CALL IFDRAW_DASH7( XPS, YPS )
     	ENDIF

999	RETURN
     	END

     	SUBROUTINE IFDRAW( XOP, YOP, IPF )
C
C  PROGRAMMER: R.S. ZHOU,	SEP-1986
C
C    	IPF =  2: DRAW TO (XOP,YOP)
C	IPF =  3: MOVE TO (XOP,YOP)
C	IPF = -3: MOVE TO (XOP,YOP) AND REORIGIN
C	IPF = -9: REORIGIN TO (XOP,YOP) ONLY
C
    	INCLUDE 'HP7550.CBS'
	SAVE IPP
C
C  CONVERT COORDINATES TO ABSOLUTE PLOTTER UNITS...
C
    	IPN = IABS(IPF)
     	IF( XANG.NE.0.0 .OR. YANG.NE.0.0 ) THEN
     	    XPS = XOP*XCTH-YOP*YSTH
     	    YPS = XOP*XSTH+YOP*YCTH
     	ELSE
     	    XPS = XOP
     	    YPS = YOP
     	ENDIF
     	XPS = XPS*XSCL
     	YPS = YPS*YSCL
     	IF( JSK.EQ.0 ) THEN
     	    XPS = XPS + XORS
     	    YPS = YPS + YORS
     	ENDIF
     	IF( IPN.EQ.9 ) GOTO 888
     	IXL = IXO+INT(FUNI*XPS)
     	IYL = IYO+INT(FUNI*YPS)
     	IF( IXL.LT.0 ) IXL = 0
     	IF( IYL.LT.0 ) IYL = 0
     	IF( IPL.GT.NBS-15 ) CALL IFINIT_DUMP

     	IF( IPN.EQ.IPP .AND. IPN.EQ.2 ) THEN
     	    IPL = IPL + 1
     	    IPB(IPL) = ','
     	ELSE
     	    IPB(IPL+1) = 'P'
     	    IPL = IPL + 2
     	    IF( IPN.EQ.2 ) THEN
     		IPB(IPL) = 'D'
     	    ELSE
     		IPB(IPL) = 'U'
     	    ENDIF
	ENDIF

     	CALL IFDRAW_CDIF( IXL )
     	IPL = IPL + 1
     	IPB(IPL) = ','
     	CALL IFDRAW_CDIF( IYL )
C
C  KEEP TRACK OF WORKING ORIGIN...
C
888	IF( IPF.LT.0 ) THEN
    	    XORS = XPS
     	    YORS = YPS
    	ENDIF
	IPP = IPN

999	RETURN
    	END

    	SUBROUTINE IFDRAW_CDIF( INTVAR )
C
C  PROGRAMMER: R.S. ZHOU
C
C	THIS ROUTINE PACKS AN INTERGER VARIABLE INTO THE GRAPHIC BUFFER.
C
    	INCLUDE 'HP7550.CBS'

    	BYTE TEXT(6)
    	DATA TEXT / 6*0 /

    	IN = INTVAR
    	ENCODE( 6, 1, TEXT ) IN
1	FORMAT(I6)
    	DO I=1, 6
    	   IF( TEXT(I).GT.32 ) THEN
    	       IPL = IPL + 1
    	       IPB(IPL) = TEXT(I)
     	   ENDIF
     	ENDDO	

    	RETURN
    	END

    	SUBROUTINE IFDRAW_CDFF( DECIMAL )
C
C  PROGRAMMER: R.S. ZHOU
C
C	THIS ROUTINE PACKS A DECIMAL VARIABLE INTO THE GRAPHIC BUFFER.
C
    	INCLUDE 'HP7550.CBS'
    	BYTE TEXT(8)
    	DATA TEXT / 8*0 /

    	DEC = DECIMAL
    	ENCODE( 8, 1, TEXT ) DEC
1	FORMAT(F8.3)
    	DO I=1, 8
    	   IF( TEXT(I).GT.42 ) THEN
    	       IPL = IPL + 1
    	       IPB(IPL) = TEXT(I)
     	   ENDIF
     	ENDDO
    	IF( IPB(IPL).NE.'0' ) GOTO 9
    	IPB(IPL) = 0
    	IPL = IPL - 1
    	IF( IPB(IPL).NE.'0' ) GOTO 9
    	IPB(IPL) = 0
    	IPL = IPL - 1
    	IF( IPB(IPL).NE.'0' ) GOTO 9
    	IPB(IPL) = 0
    	IPL = IPL - 1
9	RETURN
    	END

     	SUBROUTINE IFDRAW_LAST( XPS, YPS )
C
C	THIS ROUTINE REPORTS THE LAST PEN LOCATION
C	RELATIVE TO ACTIVE GRAPH ORIGIN IN INCHES.
C
     	INCLUDE 'HP7550.CBS'

     	XPL = FLOAT(IXL-IXO)/FUNI
     	YPL = FLOAT(IYL-IYO)/FUNI
     	IF( JSK.EQ.0 ) THEN
     	    XPL = XPL-XORS
     	    YPL = YPL-YORS
     	ENDIF
     	XPL = XPL/XSCL
     	YPL = YPL/YSCL
     	IF( XANG.NE.0.0 .OR. YANG.NE.0.0 ) THEN
     	    DET = XCTH*YCTH + XSTH*YSTH
     	    XPS = (XPL*YCTH+YPL*YSTH) / DET
     	    YPS = (YPL*XCTH-XPL*XSTH) / DET
     	ELSE
     	    XPS = XPL
     	    YPS = YPL
     	ENDIF

     	RETURN
     	END

     	SUBROUTINE IFDRAW_DASH1( X2, Y2 )
C
C   PROGRAMMER:  R.S. ZHOU,	8/1988
C
C	THIS ROUTINE DRAWS A DOTTED LINE.
C
     	PARAMETER ERR= 0.005
     	COMMON/IFDRAW_DASH/ IFID, IFIP, IFWD, DRES

     	CALL IFDRAW_LAST( X1, Y1 )	!GET THE LAST POINT.

    	DIST = SQRT( (X2-X1)**2 + (Y2-Y1)**2 )
    	IF( DIST.EQ.0.0 ) GOTO 999

     	XAD  = X1
     	YAD  = Y1
    	STH  = (Y2-Y1)/DIST
    	CTH  = (X2-X1)/DIST
     	DERR = DIST + ERR
    	FC1C = (0.03+0.01*IFWD)*CTH
    	FC1S = (0.03+0.01*IFWD)*STH
     	DOTC = (0.01*IFWD)*CTH
     	DOTS = (0.01*IFWD)*STH

    	IF( DRES.LT.0.01 ) GOTO 111
C
C  PLOT THE REMAINING SEGMENT FROM THE PREVIOUS DASH...
C
    	XAD = XAD + DRES*CTH
    	YAD = YAD + DRES*STH
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, 3 )

111	XAD = XAD + DOTC
     	YAD = YAD + DOTS
     	CALL IFDRAW( XAD, YAD,  2 )
222	XAD = XAD + FC1C
    	YAD = YAD + FC1S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, 3 )
     	XAD = XAD + DOTC
     	YAD = YAD + DOTS
     	CALL IFDRAW( XAD, YAD,  2 )
    	GOTO 222
C
C   DRAW TO THE END OF THE LINE...
C
888	CALL IFDRAW( X2, Y2, 3 )
    	DRES = DRES - DIST

999    	RETURN
    	END

     	SUBROUTINE IFDRAW_DASH2( X2, Y2 )
C
C   PROGRAMMER:  R.S. ZHOU,	8/1988
C
C	THIS ROUTINE DRAWS A DASH-DOT LINE.
C
     	PARAMETER ERR= 0.005
     	COMMON/IFDRAW_DASH/ IFID, IFIP, IFWD, DRES

     	CALL IFDRAW_LAST( X1, Y1 )	!GET THE LAST POINT.

    	DIST = SQRT( (X2-X1)**2 + (Y2-Y1)**2 )
    	IF( DIST.EQ.0.0 ) GOTO 999

     	XAD  = X1
     	YAD  = Y1
    	STH  = (Y2-Y1)/DIST
    	CTH  = (X2-X1)/DIST
     	DERR = DIST + ERR

    	IF( DRES.LT.0.01 ) GOTO 111
C
C  PLOT THE REMAINING SEGMENT FROM THE PREVIOUS DASH...
C
    	XAD = XAD + DRES*CTH
    	YAD = YAD + DRES*STH
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )

111	FC1C = (0.05+0.01*IFWD)*CTH
    	FC1S = (0.05+0.01*IFWD)*STH
     	FC2C = (0.03+0.01*IFWD)*CTH
    	FC2S = (0.03+0.01*IFWD)*STH
     	DOTC = (0.01*IFWD)*CTH
     	DOTS = (0.01*IFWD)*STH
    	IF( IFID.EQ.1 ) GOTO 333
    	IF( IFID.EQ.2 ) GOTO 444
222	IFID = 1
    	IFIP = 2
    	XAD = XAD + FC1C
    	YAD = YAD + FC1S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )
333	IFID = 2
    	IFIP = 3
    	XAD = XAD + FC2C
    	YAD = YAD + FC2S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )
444    	XAD = XAD + DOTC
     	YAD = YAD + DOTS
     	CALL IFDRAW( XAD, YAD,  2 )
    	IFID = 3
    	IFIP = 3
    	XAD = XAD + FC2C
    	YAD = YAD + FC2S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )
     	GOTO 222
C
C   DRAW TO THE END OF THE LINE...
C
888	CALL IFDRAW( X2, Y2, IFIP )
    	DRES = DRES - DIST

999    	RETURN
    	END

     	SUBROUTINE IFDRAW_DASH3( X2, Y2 )
C
C   PROGRAMMER:  R.S. ZHOU,	8/1988
C
C	THIS ROUTINE DRAWS A SHORT DASH LINE.
C
     	PARAMETER ERR= 0.005
     	COMMON/IFDRAW_DASH/ IFID, IFIP, IFWD, DRES

     	CALL IFDRAW_LAST( X1, Y1 )	!GET THE LAST POINT.

    	DIST = SQRT( (X2-X1)**2 + (Y2-Y1)**2 )
    	IF( DIST.EQ.0.0 ) GOTO 999

     	XAD  = X1
     	YAD  = Y1
    	STH  = (Y2-Y1)/DIST
    	CTH  = (X2-X1)/DIST
     	DERR = DIST + ERR

    	IF( DRES.LT.0.01 ) GOTO 111
C
C  PLOT THE REMAINING SEGMENT FROM THE PREVIOUS DASH...
C
    	XAD = XAD + DRES*CTH
    	YAD = YAD + DRES*STH
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )

111	FC1C = (0.04+0.01*IFWD)*CTH
    	FC1S = (0.04+0.01*IFWD)*STH
     	FC2C = (0.03+0.01*IFWD)*CTH
    	FC2S = (0.03+0.01*IFWD)*STH
    	IF( IFID.EQ.1 ) GOTO 333
222    	IFID = 1
    	IFIP = 2
    	XAD = XAD + FC1C
    	YAD = YAD + FC1S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )
333    	IFID = 2
    	IFIP = 3
    	XAD = XAD + FC2C
    	YAD = YAD + FC2S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD,YAD, IFIP )
    	GOTO 222
C
C   DRAW TO THE END OF THE LINE...
C
888	CALL IFDRAW( X2, Y2, IFIP )
    	DRES = DRES - DIST

999    	RETURN
    	END

     	SUBROUTINE IFDRAW_DASH4( X2, Y2 )
C
C   PROGRAMMER:  R.S. ZHOU,	8/1988
C
C	THIS ROUTINE DRAWS A MEDIUM DASH LINE.
C
     	PARAMETER ERR= 0.005
     	COMMON/IFDRAW_DASH/ IFID, IFIP, IFWD, DRES

     	CALL IFDRAW_LAST( X1, Y1 )	!GET THE LAST POINT.

    	DIST = SQRT( (X2-X1)**2 + (Y2-Y1)**2 )
    	IF( DIST.EQ.0.0 ) GOTO 999

     	XAD  = X1
     	YAD  = Y1
    	STH  = (Y2-Y1)/DIST
    	CTH  = (X2-X1)/DIST
     	DERR = DIST + ERR

    	IF( DRES.LT.0.01 ) GOTO 111
C
C  PLOT THE REMAINING SEGMENT FROM THE PREVIOUS DASH...
C
    	XAD = XAD + DRES*CTH
    	YAD = YAD + DRES*STH
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )

111	FC1C = (0.06+0.01*IFWD)*CTH
    	FC1S = (0.06+0.01*IFWD)*STH
     	FC2C = (0.03+0.01*IFWD)*CTH
     	FC2S = (0.03+0.01*IFWD)*STH
    	IF( IFID.EQ.1 ) GOTO 333
222    	IFID = 1
    	IFIP = 2
    	XAD = XAD + FC1C
    	YAD = YAD + FC1S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )
333    	IFID = 2
    	IFIP = 3
    	XAD = XAD + FC2C
    	YAD = YAD + FC2S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD,YAD, IFIP )
    	GOTO 222
C
C   DRAW TO THE END OF THE LINE...
C
888	CALL IFDRAW( X2, Y2, IFIP )
    	DRES = DRES - DIST

999    	RETURN
    	END

     	SUBROUTINE IFDRAW_DASH5( X2, Y2 )
C
C   PROGRAMMER:  R.S. ZHOU,	8/1988
C
C	THIS ROUTINE DRAWS A THREE-DOT CENTER LINE.
C
     	PARAMETER ERR= 0.005
     	COMMON/IFDRAW_DASH/ IFID, IFIP, IFWD, DRES

     	CALL IFDRAW_LAST( X1, Y1 )	!GET THE LAST POINT.

    	DIST = SQRT( (X2-X1)**2 + (Y2-Y1)**2 )
    	IF( DIST.EQ.0.0 ) GOTO 999

     	XAD  = X1
     	YAD  = Y1
    	STH  = (Y2-Y1)/DIST
    	CTH  = (X2-X1)/DIST
     	DERR = DIST + ERR

    	IF( DRES.LT.0.01 ) GOTO 111
C
C  PLOT THE REMAINING SEGMENT FROM THE PREVIOUS DASH...
C
    	XAD = XAD + DRES*CTH
    	YAD = YAD + DRES*STH
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )

111	FC1C = (0.10+0.01*IFWD)*CTH
    	FC1S = (0.10+0.01*IFWD)*STH
     	FC2C = (0.03+0.01*IFWD)*CTH
    	FC2S = (0.03+0.01*IFWD)*STH
     	DOTC = (0.01*IFWD)*CTH
     	DOTS = (0.01*IFWD)*STH
    	IF( IFID.EQ.1 ) GOTO 333
    	IF( IFID.EQ.2 ) GOTO 444
    	IF( IFID.EQ.3 ) GOTO 555
    	IF( IFID.EQ.4 ) GOTO 666
222	IFID = 1
    	IFIP = 2
    	XAD = XAD + FC1C
    	YAD = YAD + FC1S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )
333	IFID = 2
    	IFIP = 3
    	XAD = XAD + FC2C
    	YAD = YAD + FC2S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )
444    	XAD = XAD + DOTC
     	YAD = YAD + DOTS
     	CALL IFDRAW( XAD, YAD,  2 )
    	IFID = 3
    	IFIP = 3
    	XAD = XAD + FC2C
    	YAD = YAD + FC2S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )
555	XAD = XAD + DOTC
     	YAD = YAD + DOTS
     	CALL IFDRAW( XAD, YAD,  2 )
    	IFID = 4
    	IFIP = 3
    	XAD = XAD + FC2C
    	YAD = YAD + FC2S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )
666	XAD = XAD + DOTC
     	YAD = YAD + DOTS
     	CALL IFDRAW( XAD, YAD,  2 )
    	IFID = 5
    	IFIP = 3
    	XAD = XAD + FC2C
    	YAD = YAD + FC2S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )
     	GOTO 222
C
C   DRAW TO THE END OF THE LINE...
C
888	CALL IFDRAW( X2, Y2, IFIP )
    	DRES = DRES - DIST

999    	RETURN
    	END

     	SUBROUTINE IFDRAW_DASH6( X2, Y2 )
C
C   PROGRAMMER:  R.S. ZHOU,	8/1988
C
C	THIS ROUTINE DRAWS A LONG-SHORT DASH LINE.
C
     	PARAMETER ERR= 0.005
     	COMMON/IFDRAW_DASH/ IFID, IFIP, IFWD, DRES

     	CALL IFDRAW_LAST( X1, Y1 )	!GET THE LAST POINT.

    	DIST = SQRT( (X2-X1)**2 + (Y2-Y1)**2 )
    	IF( DIST.EQ.0.0 ) GOTO 999

     	XAD  = X1
     	YAD  = Y1
    	STH  = (Y2-Y1)/DIST
    	CTH  = (X2-X1)/DIST
     	DERR = DIST + ERR

    	IF( DRES.LT.0.01 ) GOTO 111
C
C  PLOT THE REMAINING SEGMENT FROM THE PREVIOUS DASH...
C
    	XAD = XAD + DRES*CTH
    	YAD = YAD + DRES*STH
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )

111	FC1C = (0.08+0.01*IFWD)*CTH
    	FC1S = (0.08+0.01*IFWD)*STH
    	FC2C = (0.03+0.01*IFWD)*CTH
    	FC2S = (0.03+0.01*IFWD)*STH
    	FC3C = (0.03+0.01*IFWD)*CTH
    	FC3S = (0.03+0.01*IFWD)*STH
    	IF( IFID.EQ.1 ) GOTO 333
    	IF( IFID.EQ.2 ) GOTO 444
    	IF( IFID.EQ.3 ) GOTO 555
222	IFID = 1
    	IFIP = 2
    	XAD = XAD + FC1C
    	YAD = YAD + FC1S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )
333	IFID = 2
    	IFIP = 3
    	XAD = XAD + FC3C
    	YAD = YAD + FC3S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )
444	IFID = 3
    	IFIP = 2
    	XAD = XAD + FC2C
    	YAD = YAD + FC2S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )
555	IFID = 4
    	IFIP = 3
    	XAD = XAD + FC3C
    	YAD = YAD + FC3S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )
    	GOTO 222
C
C   DRAW TO THE END OF THE LINE...
C
888	CALL IFDRAW( X2, Y2, IFIP )
    	DRES = DRES - DIST

999    	RETURN
    	END

     	SUBROUTINE IFDRAW_DASH7( X2, Y2 )
C
C   PROGRAMMER:  R.S. ZHOU,	8/1988
C
C	THIS ROUTINE DRAWS A LOOSE DASH LINE.
C
     	PARAMETER ERR= 0.005
     	COMMON/IFDRAW_DASH/ IFID, IFIP, IFWD, DRES

     	CALL IFDRAW_LAST( X1, Y1 )	!GET THE LAST POINT.

    	DIST = SQRT( (X2-X1)**2 + (Y2-Y1)**2 )
    	IF( DIST.EQ.0.0 ) GOTO 999

     	XAD  = X1
     	YAD  = Y1
    	STH  = (Y2-Y1)/DIST
    	CTH  = (X2-X1)/DIST
     	DERR = DIST + ERR

    	IF( DRES.LT.0.01 ) GOTO 111
C
C  PLOT THE REMAINING SEGMENT FROM THE PREVIOUS DASH...
C
    	XAD = XAD + DRES*CTH
    	YAD = YAD + DRES*STH
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )

111	FC1C = (0.04+0.01*IFWD)*CTH
    	FC1S = (0.04+0.01*IFWD)*STH
     	FC2C = (0.05+0.01*IFWD)*CTH
    	FC2S = (0.05+0.01*IFWD)*STH
    	IF( IFID.EQ.1 ) GOTO 333
222    	IFID = 1
    	IFIP = 2
    	XAD = XAD + FC1C
    	YAD = YAD + FC1S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD, YAD, IFIP )
333    	IFID = 2
    	IFIP = 3
    	XAD = XAD + FC2C
    	YAD = YAD + FC2S
    	DRES = SQRT( (XAD-X1)**2 + (YAD-Y1)**2 )
    	IF( DRES.GT.DERR ) GOTO 888
    	CALL IFDRAW( XAD,YAD, IFIP )
    	GOTO 222
C
C   DRAW TO THE END OF THE LINE...
C
888	CALL IFDRAW( X2, Y2, IFIP )
    	DRES = DRES - DIST

999    	RETURN
    	END

