     	SUBROUTINE IFSPEN( IPEN )
C
C  PROGRAMMER: R.S. ZHOU	SEP-1986
C
C	THIS ROUTINE SELECTS A NEW PEN OF NUMBER "IPEN".
C
    	INCLUDE 'HP7550.CBS'

     	IPN = IPEN
     	IF( IPN.EQ.ILP ) GOTO 999
     	IF( IPN.LT.1 .OR. IPN.GT.8 ) IPN = 1
     	IF( IPL.GT.NBS-3 ) CALL IFINIT_DUMP
     	IPB(IPL+1) = 'S'
     	IPB(IPL+2) = 'P'
     	IPB(IPL+3) = 48 + IPN
     	IPL = IPL + 3
     	ILP = IPN

999	RETURN
    	END

