*"表題 文字記述子の参照/設定 GTOOL3(GHCGTS)
*
*"履歴 90/08/21 沼口  敦
*
*
*********************************************************************
*"         << 文字記述子の参照 >>
**********************************************************************
      SUBROUTINE GHCGTS
     I         ( HHEAD, HP    ,
     O           HX            )
*
      CHARACTER  HHEAD ( * )*(*)         !" ヘッダー
      CHARACTER  HP         *(*)         !" ヘッダーの欄指定
      CHARACTER  HX         *(*)         !" 記述子の内容：文字
*
#ifdef SYS_IBMS
      INCLUDE    (GZSIZE)                !" NCC, NDC
#else
#include         "gzsize.F"              !" NCC, NDC
#endif
      CHARACTER  HPN        *(NCC)
      CHARACTER  HNUM       *(NCC)
      CHARACTER  HFM        *(NCC)
      INTEGER    NHT
*
      NHT = LEN ( HX )
      NHP = LENC( HP )
      HX  = ' '
*
      CALL GHPINQ ( HP  , HFM  )
      IF ( HFM .NE. ' ' ) THEN
         CALL GHCGET
     I      ( HHEAD   , HP    ,
     O        HX               )
*
      ELSE
         DO 1100 I = 1, ( NHT+NCC-1 )/NCC
            WRITE ( HNUM, '(I2)' ) I
            CALL CLADJ( HNUM )
            HPN = HP(1:NHP)//HNUM
*
            IHS = (I-1)*NCC+1
            IHE = MIN( I*NCC, NHT )
*
            CALL GHPINQ ( HPN   , HFM   )
            IF ( ( I.EQ.1 ).OR.( HFM.NE.' ' ) ) THEN
               CALL GHCGET
     I            ( HHEAD   , HPN   ,
     O              HX(IHS:IHE)      )
            ENDIF
 1100    CONTINUE
      ENDIF
*
      RETURN
*=====================================================================
*"         << 文字記述子の設定 >>
*=====================================================================
      ENTRY      GHCSTS
     I         ( HHEAD, HP    ,
     I           HX            )
*
      NHT = LENC( HX )
      NHP = LENC( HP )
*
      CALL GHPINQ ( HP   , HFM   )
      IF ( HFM .NE. ' ' ) THEN
         CALL GHCSET
     I      ( HHEAD   , HP    ,
     I        HX               )
*
      ELSE
         DO 2100 I = 1, NDC
            WRITE ( HNUM, '(I2)' ) I
            CALL CLADJ( HNUM )
            HPN = HP(1:NHP)//HNUM
*
            IHS = (I-1)*NCC+1
            IHE = MIN( I*NCC, NHT )
*
            CALL GHPINQ ( HPN   , HFM   )
            IF      ( ( I.EQ.1 ).OR.
     &                ((HFM.NE.' ').AND.(IHS.LE.IHE))  ) THEN
               CALL GHCSET
     I            ( HHEAD   , HPN   ,
     I              HX(IHS:IHE)      )
            ELSE IF ( HFM .NE. ' ' ) THEN
               CALL GHCSET
     I            ( HHEAD   , HPN   ,
     I              ' '              )
            ENDIF
 2100    CONTINUE
      ENDIF
*
      RETURN
      END
