      SUBROUTINE SETFG (ICOL, ICURS)
      IMPLICIT NONE
C
C ***      SET THE FOREGROUND PEN COLOR
C
      INTEGER ICOL
      CHARACTER*(*) ICURS
C
      INCLUDE MATLAB$KOM:IOP.KOM
      INCLUDE MATLAB$KOM:MATPLT.KOM
C
C
105   CONTINUE
      CALL DSSTRN (' ENTER THE PLOT PEN NUMBER', 1)
      CALL DSCURS (ICURS)
      CALL VALGET (0, ICOL, 'I')
      IF (WIO.NE.0) WRITE (WIO, 108) ICOL
108   FORMAT (1X, I2)
      IF (ICOL.LT.0 .OR. ICOL.GT.15) THEN
        CALL DSERR ('ERROR.  COLOR NUMBER MUST BE BETWEEN 0 AND 15')
        GOTO 105
      ENDIF
C
      RETURN
      END
