C-----------------------------------------------------------------------
C  GFTCSS -- SET SG SYMBOL CODES
C
      SUBROUTINE GFTCSS
C
      INCLUDE 'GFTIC'
C
      LOGICAL, EXTERNAL :: LCHAR,LXOUT,LYES,LYESC
C
C------------------------------
C
      if(.not.init_gftic) call gftic0
C
      LUNTRM=LNOUT(0)
C
      IMAXI=IGFTMAXS  ! MAXIMUM SYMBOL CODE INDEX
C
      CALL NEUPAG
 10   CONTINUE
      IF(LXOUT(0)) THEN
        WRITE(LUNTRM,1001) (I,LSYSTL(I),I=1,IMAXI)
 1001   FORMAT(/' CURRENT SYMBOL SELECTION CODES:'/
     >    5(1X,I2,':  ',I2,4X)/)
        WRITE(LUNTRM,1002) IMAXI
 1002   FORMAT(
     >    ' THE MEANING OF SYMBOL SELECTION CODES ARE DESCRIBED IN THE'/
     >    ' SGLIB HELP FILE.  LEGAL CODE VALUES RANGE FROM -11 TO -1'/
     >    ' (FOR FILLED IN SYMBOLS) AND 1 TO 15 ("REGULAR" SYMBOLS).'//
     >    ' OPTIONS:'/
     >    '  >ENTER A NUMBER BTW 1 AND ',I2,' TO MODIFY CORRESPONDING'/
     >    '      SYMBOL SELECTION CODE'/
     >    '  >ENTER "Q" TO QUIT (NO MORE CHANGES)'/)
      ENDIF
      CALL UREAD('GFTCSS:  ENTER SYMBOL CODE MODIFICATION OPTION:$')
      IF(LCHAR('Q')) RETURN
C
      INDX=IDCOD(IERT)
      IF(IERT.NE.0) GO TO 10
C
      IF((INDX.LT.1).OR.(INDX.GT.IMAXI)) THEN
        CALL UERMSI(' SYMBOL CODE INDEX OUT OF RANGE',INDX,1)
        GO TO 10
      ENDIF
C
      ICOD=LSYSTL(INDX)
      CALL UREADI(' ENTER NEW SYMBOL CODE:$',ICOD)
C
      IF((ICOD.LT.-11).OR.(ICOD.EQ.0).OR.(ICOD.GT.15)) THEN
        CALL UERMSI(' SYMBOL CODE VALUE OUT OF RANGE',ICOD,1)
        GO TO 10
      ENDIF
C
      LSYSTL(INDX)=ICOD
C
      GO TO 10
      END
