C----------------------------------------------------------------------
C  GFTICJ  ACCEPT CONTROL VALUE FROM TERMINAL
C
      SUBROUTINE GFTICJ(ZSG,IVALX,IVALY,IDFLT,IMIN,IMAX)
C
      CHARACTER*8 ZSG
C
C
C *LISMAK* 12-APR-88  GENERATED LOGICAL DECLARATIONS
      LOGICAL LCHAR
      LOGICAL LXOUT
C *LISMAK* END OF GENERATED LOGICAL DECLARATIONS
C
      LUNTRM=LNOUT(0)
C
 5    CONTINUE
C
      IF(LXOUT(0)) WRITE(LUNTRM,1001)
 1001   FORMAT(
     >' %ENTER CONTROL CODE VALUE; "D" FOR DEFAULT VALUE SELECTION'/
     >'  "Q" TO QUIT WITHOUT SPECIFYING NEW VALUE.'/
     >'  PROMPT TO APPLY TO X AXIS, Y AXIS, OR BOTH, WILL FOLLOW'/)
C
 10   CONTINUE
      CALL UREAD(
     >'GFTICI:  ENTER '//ZSG//' CONTROL CODE NEW VALUE, OR "Q":$$')
      IF(LCHAR('Q')) THEN
        GO TO 1000
      ELSE IF(LCHAR('D')) THEN
        IVAL=IDFLT
      ELSE
        IVAL=IDCOD(IERT)
        IF(IERT.NE.0) GO TO 10
        IF((IMIN.GT.IVAL).OR.(IMAX.LT.IVAL)) THEN
          CALL UERMSI(
     >'%GFTICI - CONTROL CODE VALUE OUT OF RANGE',IVAL,0)
          GO TO 10
        ENDIF
      ENDIF
C
      IF(LXOUT(0)) WRITE(LUNTRM,1003) ZSG,IVAL
 1003   FORMAT(' % NEW ',A,' VALUE = ',I2,
     >           '; ENTER "Q" TO ABORT CHANGE')
C
      CALL UREAD(
     >'GFTICI:  ENTER "X" TO APPLY TO X AXIS, "Y" FOR Y AXIS, "B" FOR'//
     >'BOTH:$')
C
      IF(LCHAR('Q')) THEN
        GO TO 1000
      ELSE IF(LCHAR('X')) THEN
        IVALX=IVAL
      ELSE IF(LCHAR('Y')) THEN
        IVALY=IVAL
      ELSE IF(LCHAR('B')) THEN
        IVALX=IVAL
        IVALY=IVAL
      ELSE
        CALL UERMSG('GFTICI:  WHAT?',' ',0)
        GO TO 5
      ENDIF
C
 1000   CONTINUE
      RETURN
      END
