      SUBROUTINE HPFORM
C  FORMATTER ROUTINE FOR THE HP7580A
C
C
      CHARACTER*3 PD,PU
      CHARACTER*13 STRING
C
$INCLUDE:'pxz99.cmn'
         COMMON /HPSIZE/ WIDTH,HEIGHT,ICOM
C
      EQUIVALENCE (IDWRK(1),IXLS1),(IDWRK(2),IXLS2),(IDWRK(3),IYLS1)
     1 ,(IDWRK(4),IYLS2),(IDWRK(5),IPEN),(IDWRK(6),IPLTST),
     2  (IDWRK(7),IPCHAR),(IDWRK(8),IXLS3),(IDWRK(9),IYLS3)
      DATA PD/' PD'/,PU/' PU'/,NCHAR/3/
C
C
C
	DO 200 I = 1, NXYRS
		IF (IPENC(I) .EQ. 0) THEN
			IF (IPEN .NE. 0) THEN
                                IF (ICOM.EQ.0) THEN
                                        WRITE(20,'(A)') PD(1:NCHAR)
                                ELSE
                                        CALL SNDCHR(PD,NCHAR,IER)
                                ENDIF
				IPEN = 0
			ENDIF
		ELSE
                        IF (ICOM.EQ.0) THEN
                                WRITE(20,'(A)') PU(1:NCHAR)
                        ELSE
                                CALL SNDCHR(PU,NCHAR,IER)
                        endif
                        IPEN = 1
		ENDIF
C		SEND PLOT ABSOLUTE INSTRUCTION TO HP.
             WRITE(STRING,100) IXRAS(I),IYRAS(I)
100          FORMAT(' ',I5,',',I5,',')
             IF (ICOM.EQ.0) THEN
                WRITE(20,'(A)') STRING(1:13)
             ELSE
                CALL SNDCHR(STRING,13,IER)
             ENDIF
200	CONTINUE
	RETURN
	END
