



      SUBROUTINE GENHELP (HITEMIN,DONE)


















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IERR, GVFLEN, GVFPOS, LENTOP
      CHARACTER*6   HITEMIN
      LOGICAL       DONE
      CHARACTER*2   CHAPNB
      CHARACTER*80  LOCTOP, LOCLIN







      IF (HITEMIN.EQ.'      ') THEN
         CALL GETWORD (HITEM,IERR)
         IF (IERR.NE.0) GOTO 998
      ELSE
         HITEM=HITEMIN
      END IF



      DONE=.FALSE.



      CALL INF001A ('GENERA',HITEM,LOCTOP,IERR)
      IF (IERR.NE.0) GOTO 998





      CALL INF001B (CHAPNB,IERR)
      IF (IERR.NE.0) GOTO 998



      LENTOP=GVFLEN(LOCTOP)
   10 CONTINUE



         CALL GVSFMT ('?FMT111')
         CALL GVSCTB (LOCLIN,80)
         READ (11,FMT,ERR=999,END=100) LOCLIN
         IF (LOCLIN(1:2).NE.CHAPNB(1:2)) GOTO 10



         IF (GVFPOS(LOCLIN,LOCTOP(1:LENTOP)).NE.0) THEN



            BACKSPACE (11)
            CALL INF001C (LOCTOP,CHAPNB,'Info')
            DONE=.TRUE.
         END IF
      GOTO 10



  100 CONTINUE
      GOTO 998



  999 CONTINUE
      CALL GVSTTE ('?BUGG01')
      CALL GVSTT6 ('IN GENHELP')



  998 CONTINUE


      RETURN
      END
      SUBROUTINE INF001 (ICHAP,TOPIC)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IERR, GVFLEN, GVFPOS, LENTOP
      LOGICAL       INFFND, DONE
      CHARACTER*(*) TOPIC
      CHARACTER*(*) ICHAP
      CHARACTER*2   CHAPNB
      CHARACTER*80  LOCTOP, LOCLIN







      INFFND=.FALSE.



      CALL INF001A (ICHAP,TOPIC,LOCTOP,IERR)
      IF (IERR.NE.0) GOTO 998





      CALL INF001B (CHAPNB,IERR)



      LENTOP=GVFLEN(LOCTOP)
   10 CONTINUE



         CALL GETLINE (11,LOCLIN,IERR)
         IF (IERR.EQ.1) GOTO 999
         IF (IERR.EQ.2) GOTO 100
         IF (LOCLIN(1:2).NE.CHAPNB(1:2)) GOTO 10




         IF (GVFPOS(LOCLIN,'INTRODUCTION.').NE.0) THEN



            BACKSPACE (11)
            CALL INF001C (ICHAP,CHAPNB,'Info')
         END IF



         IF (GVFPOS(LOCLIN,LOCTOP(1:LENTOP)).NE.0) THEN
            INFFND=.TRUE.



            BACKSPACE (11)
            CALL INF001C (LOCTOP,CHAPNB,'Info')
         END IF
      GOTO 10



  100 CONTINUE
      IF (.NOT.INFFND) THEN
         CALL GENHELP (TOPIC,DONE)
         IF (.NOT.DONE.AND.WIFPAR(925).EQ.0) CALL SHOWTEXT ('?M0407')
      END IF
      GOTO 998



  999 CONTINUE
      CALL GVSTTE ('?BUGG01')
      CALL GVSTT6 ('IN INF001')



  998 CONTINUE


      RETURN
      END
      SUBROUTINE INF001A (ICHAP,TOPIC,LOCTOP,IERR)


















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IERR, GVFLEN
      LOGICAL       GVFISF
      CHARACTER*(*) TOPIC
      CHARACTER*(*) ICHAP
      CHARACTER*80  LOCTOP







      IF (GVFLEN(TOPIC).LE.0) THEN
         CALL GVSTTE ('?BUGG02')
         IERR=1
         GOTO 998
      END IF




      IERR=0
      CALL GVSCTB (LOCTOP,80)
      CALL GVSCCC (LOCTOP,'(',TOPIC(1:GVFLEN(TOPIC)))
      CALL GVSCPC (LOCTOP,')')
      CALL GVSCUC (LOCTOP)



      CALL GVSCC3 (LINE2,FILDIR(25),ICHAP,'.INF')
      CALL GVSTCP (LINE2)
      IF (.NOT.GVFISF(LINE2)) THEN
         CALL GVSNL6 (5)
         CALL GVSTT6 ('?BUGG03')
         CALL GVST6C ('?M2299',LINE2,.TRUE.)
         CALL GVSNL6 (5)
         IERR=1
         GOTO 998
      END IF



      CALL GETFILE (11,' ',LINE2,IERR)



  998 CONTINUE


      RETURN
      END
      SUBROUTINE INF001B (CHAPNB,IERR)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IERR, GVFLEN, GVFLFI, I, ICHAPNB
      CHARACTER*2   CHAPNB
      CHARACTER*80  LOCLIN







      IERR=0





   10 CONTINUE
      CALL GVSFMT ('?FMT111')
      CALL GVSCTB (LOCLIN,80)
      READ (11,FMT,ERR=999,END=999) LOCLIN
         IF (GVFLEN(LOCLIN).GT.10) THEN
            I=GVFLFI(1,ICHAPNB,LOCLIN)
            IF (I.EQ.1) THEN
               IF (ICHAPNB.LE.9) THEN
                  CALL GVSFMT ('?FMT681')
                  WRITE (CHAPNB,FMT,ERR=997) ICHAPNB
               ELSE IF (ICHAPNB.LE.99) THEN
                  CALL GVSFMT ('?FMT119')
                  WRITE (CHAPNB,FMT,ERR=997) ICHAPNB
               END IF
               GOTO 998
            END IF
         END IF
      GOTO 10



 997  CONTINUE
      CALL GVSEIW ('INF001B')



  999 CONTINUE
      CALL GVSTTE ('?BUGG05')
      IERR=1



  998 CONTINUE


      RETURN
      END
      SUBROUTINE INF001C (LOCTOP,CHAPNB,WHO)


















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IERR, GVFLEN, GVFPOS, LENLOC, LENLIN, LL2, I, LINDON
      LOGICAL       GVFISN
      CHARACTER*2   CHAPNB
      CHARACTER*4   WHO
      CHARACTER*(*) LOCTOP
      CHARACTER*80  LOCLIN, TOPIC







      CALL GVSNL6 (3)



      LENLOC=GVFLEN(LOCTOP)
      IF (LOCTOP(LENLOC:LENLOC).EQ.')') LENLOC=LENLOC-1
      CALL GVSFMT ('?FMT682')
      IF (LOCTOP(1:1).EQ.'(') THEN
         WRITE (TOPIC,FMT,ERR=998) WHO,(LOCTOP(I:I),I=2,LENLOC)
      ELSE
         WRITE (TOPIC,FMT,ERR=998) WHO,(LOCTOP(I:I),I=1,LENLOC)
      END IF
      CALL GVSTT6 (TOPIC)
      CALL GVSNL6 (1)
      CALL GETLINE (11,LOCLIN,IERR)
      IF (IERR.NE.0) GOTO 997
      LENLIN=GVFLEN(LOCLIN)
      IF (LENLIN.GT.0) CALL GVSTT6 (LOCLIN(1:LENLIN))
      CALL GVSNL6 (1)
      LINDON=4



   10 CONTINUE
      CALL GVSFMT ('?FMT111')
      CALL GVSCTB (LINE2,80)
      READ (11,FMT,ERR=999,END=997) LINE2
      IF (GVFLEN(LINE2).EQ.0) GOTO 10
      IF (GVFLEN(LINE2).GT.20) THEN
         LL2=GVFLEN(LINE2)
         IF (LL2.LE.1) GOTO 10
      END IF



      IF ((CHAPNB.EQ.'0 '.AND.GVFISN(LINE2(1:1)).AND.
     + LINE2(7:8).EQ.'  ').OR.(GVFPOS(LINE2,CHAPNB(1:2)).NE.0)) THEN



         BACKSPACE (11)
         CALL GVSNL6 (2)
         GOTO 997
      END IF
      LENLIN=GVFLEN(LINE2)
      IF (LENLIN.GT.0) CALL GVSTT6 (LINE2(1:LENLIN))
      LINDON=LINDON+1
      GOTO 10



  999 CONTINUE
      CALL GVSTTE ('?BUGG05')
      GOTO 997



  998 CONTINUE
      CALL GVSEIW ('INF001C')



  997 CONTINUE


      RETURN
      END
      SUBROUTINE INF002 (OPTION,OPTIES,NUMOPT,TRICHR,IERR)





















      IMPLICIT      NONE
      INTEGER       IERR, GVFLEN, GVFPOS, IHITS, I, LENOPT,
     +              NUMOPT, IOPT, ISCORE
      LOGICAL       GVFEND
      CHARACTER*6   OPTION, OPTIES(NUMOPT), NEWOPT, LOCOPT, TMPOPT
      CHARACTER*3   TRICHR
      CHARACTER*80  LINE







      IF (GVFLEN(OPTION).LE.1) THEN
         IERR=1
         GOTO 998
      END IF
      IF (NUMOPT.LE.0) THEN
         CALL GVSTTB ('?BUGG17')
         IERR=1
         GOTO 998
      END IF
      CALL GVSSTX (LOCOPT,OPTION)



      IF (GVFEND(OPTION)) THEN
         IERR=0
         GOTO 998
      END IF
      IF (GVFPOS(OPTION,'SHORT').NE.0.OR.
     +    GVFPOS(OPTION,'FIND').NE.0.OR.
     +    GVFPOS(OPTION,'HELP').NE.0.OR.
     +    GVFPOS(OPTION,'INFO').NE.0.OR.
     +    GVFPOS(OPTION,'MORE').NE.0.OR.
     +    GVFPOS(OPTION,'LESS').NE.0.OR.
     +    GVFPOS(OPTION,'PARAMS').NE.0) THEN
         IERR=0
         GOTO 998
      END IF



      CALL GVSSHL (OPTION)
      IF (GVFLEN(OPTION).LE.3) THEN
         CALL GVSSTX (OPTION(4:6),OPTION(1:3))
         CALL GVSSTX (OPTION(1:3),TRICHR)
      END IF





      IERR=0
      CALL GVSCTB (NEWOPT,6)



      DO 5 IOPT=1,NUMOPT
         IF (OPTION.EQ.OPTIES(IOPT)) THEN
            GOTO 998
         END IF
    5 CONTINUE




      LENOPT=GVFLEN(OPTION(1:6))
      IF (LENOPT.EQ.5) THEN
         NEWOPT(1:3)=OPTION(3:5)
         NEWOPT(4:5)=OPTION(1:2)
         DO 9 IOPT=1,NUMOPT
            IF (NEWOPT.EQ.OPTIES(IOPT)) GOTO 100
    9    CONTINUE
      END IF



      LENOPT=GVFLEN(OPTION(1:6))
      IF (LENOPT.GT.3) THEN
         NEWOPT(1:3)=OPTION(4:LENOPT)
         NEWOPT(4:6)=OPTION(1:3)
         CALL GVSTCP (NEWOPT)
         DO 11 IOPT=1,NUMOPT
            IF (NEWOPT.EQ.OPTIES(IOPT)) GOTO 100
   11    CONTINUE
      END IF



      DO 16 I=1,GVFLEN(OPTION)
         IF (OPTION(I:I).EQ.'0') THEN
            CALL GVSSTX (NEWOPT,OPTION)
            NEWOPT(I:I)='O'
            DO 12 IOPT=1,NUMOPT
               IF (NEWOPT.EQ.OPTIES(IOPT)) THEN
                  CALL GVSTT6 ('?M0771')
                  GOTO 100
               END IF
   12       CONTINUE
         END IF
         IF (OPTION(I:I).EQ.'O') THEN
            CALL GVSSTX (NEWOPT,OPTION)
            NEWOPT(I:I)='0'
            DO 14 IOPT=1,NUMOPT
               IF (NEWOPT.EQ.OPTIES(IOPT)) THEN
                  CALL GVSTT6 ('?M0771')
                  GOTO 100
               END IF
   14       CONTINUE
         END IF
   16 CONTINUE



      DO 26 I=1,GVFLEN(OPTION)
         IF (OPTION(I:I).EQ.'I') THEN
            CALL GVSSTX (NEWOPT,OPTION)
            NEWOPT(I:I)='1'
            DO 22 IOPT=1,NUMOPT
               IF (NEWOPT.EQ.OPTIES(IOPT)) THEN
                  CALL GVSTT6 ('?M0771')
                  GOTO 100
               END IF
   22       CONTINUE
         END IF
         IF (OPTION(I:I).EQ.'1') THEN
            CALL GVSSTX (NEWOPT,OPTION)
            NEWOPT(I:I)='I'
            DO 24 IOPT=1,NUMOPT
               IF (NEWOPT.EQ.OPTIES(IOPT)) THEN
                  CALL GVSTT6 ('?M0771A')
                  GOTO 100
               END IF
   24       CONTINUE
         END IF
   26 CONTINUE



      IHITS=0
      DO 50 IOPT=1,NUMOPT
         IF (OPTIES(IOPT).NE.'      ') THEN



            CALL INF003 (OPTION,OPTIES(IOPT),ISCORE)



            IF (ISCORE.GE.5) THEN
               IHITS=IHITS+1



               IF (IHITS.GE.2) THEN
                  IERR=1
                  GOTO 998
               END IF
               CALL GVSSTX (NEWOPT,OPTIES(IOPT))
               GOTO 100
            END IF
         END IF
   50 CONTINUE



      LENOPT=GVFLEN(OPTION(1:6))
      IHITS=0
      IF (LENOPT.GT.1) THEN
         DO 70 I=1,LENOPT-1
            CALL GVSSTX (NEWOPT,OPTION)
            NEWOPT(I:I)=OPTION(I+1:I+1)
            NEWOPT(I+1:I+1)=OPTION(I:I)
            DO 60 IOPT=1,NUMOPT
               IF (NEWOPT.EQ.OPTIES(IOPT)) THEN
                  CALL GVSSTX (TMPOPT,NEWOPT)
                  IHITS=IHITS+1
               END IF
   60       CONTINUE
   70    CONTINUE
         IF (IHITS.EQ.1) THEN
            CALL GVSSTX (NEWOPT,TMPOPT)
            GOTO 100
         END IF
      END IF



      IF (IHITS.EQ.0) THEN



         CALL GVSSTX (OPTION,LOCOPT)
         IERR=1
         GOTO 998
      END IF



  100 CONTINUE
      CALL GVSSTX (LINE,'?GENOPC')
      CALL GVSSTX (LINE(50:60),OPTION)
      CALL GVSSTX (LINE(60:70),'->')
      CALL GVSSTX (LINE(70:80),NEWOPT)
      CALL GVSRDB (LINE)
      IF (OPTION(1:6).EQ.NEWOPT(1:6).OR.(NEWOPT(1:3).EQ.OPTION(4:6).AND.
     +    NEWOPT(4:6).EQ.OPTION(1:3))) THEN
         CALL GVSSTX (OPTION(1:6),NEWOPT(1:6))
      ELSE
         CALL GVSTT6 (LINE)
         CALL GVSSTX (OPTION(1:6),NEWOPT(1:6))
      END IF



  998 CONTINUE


      RETURN
      END
      SUBROUTINE INF003 (OPTIE1,OPTIE2,LBMAX)
























      IMPLICIT      NONE
      CHARACTER*6   OPTIE1, OPTIE2
      INTEGER       LH(7,7), LBMAX, I, II, LD, LA, KK, JJ, LB, J, K







      CALL GVSIT0 (LH,7*7)



      DO 80 JJ=1,6
         J=JJ+1
         DO 70 II=1,6
            I=II+1
            LBMAX=0
            IF (OPTIE1(II:II).EQ.OPTIE2(JJ:JJ)) THEN
               LD=1
            ELSE
               LD=0
            END IF
            LA=LH(II,JJ)+LD
            IF (LA.GE.LBMAX) THEN
               LBMAX=LA
            END IF
            KK=MAX(1,JJ-1)
            DO 30 K=JJ,KK,-1
               LB=LH(I,K)
               IF (LB.GT.LBMAX) THEN
                  LBMAX=LB
               END IF
   30       CONTINUE
            KK=MAX(1,JJ-1)
            DO 50 K=II,KK,-1
               LB=LH(K,J)
               IF (LB.GT.LBMAX) THEN
                  LBMAX=LB
               END IF
   50       CONTINUE
            LH(I,J)=LBMAX
   70    CONTINUE
   80 CONTINUE





      RETURN
      END
      SUBROUTINE INF004 (ICHAP,TOPIC)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'IRIGRA.INC'
      INTEGER       IERR, GVFLEN, GVFPOS, LENTOP
      LOGICAL       FNDHLP, AHEAD, DONE
      CHARACTER*(*) TOPIC
      CHARACTER*(*) ICHAP
      CHARACTER*2   CHAPNB
      CHARACTER*80  LOCTOP, LOCLIN







      FNDHLP=.FALSE.
      IF (AHEAD()) GOTO 998
      IF (IRSTAT(6).EQ.1) GOTO 998
      WIFPAR(1065)=1



      CALL INF001A (ICHAP,TOPIC,LOCTOP,IERR)
      IF (IERR.NE.0) GOTO 998





      CHAPNB='0 '
      CALL INF001B (CHAPNB,IERR)
      IF (IERR.NE.0) GOTO 999



      LENTOP=GVFLEN(LOCTOP)
   10 CONTINUE



         CALL GVSCTB (LOCLIN,80)
         CALL GETLINE (11,LOCLIN,IERR)
         IF (IERR.NE.0) THEN
            IF (.NOT.FNDHLP) THEN
               CALL GENHELP (TOPIC,DONE)
               IF (.NOT.DONE.AND.WIFPAR(925).EQ.0)
     +          CALL SHOWTEXT ('?M0407')
               GOTO 998
            END IF
         END IF
         IF (LOCLIN(1:2).NE.CHAPNB(1:2)) GOTO 10




         IF (GVFPOS(LOCLIN,LOCTOP(1:LENTOP)).NE.0) THEN
            FNDHLP=.TRUE.
            BACKSPACE (11)
            CALL INF001C (LOCTOP,CHAPNB,'Help')
            WIFPAR(1065)=0
            GOTO 998
         END IF
      GOTO 10



  999 CONTINUE
      CALL GVST6C ('?M2300',CHAPNB,.TRUE.)



  998 CONTINUE


      RETURN
      END
      SUBROUTINE INF004D (ICHAP,TOPIC)



















      IMPLICIT      NONE
      INCLUDE       'OPTION.INC'
      CHARACTER*(*) ICHAP,TOPIC







      IF (IAMDUMB) THEN



         CALL WIFPUSHPPP (925,1)
         CALL INF004 (ICHAP,TOPIC)



         CALL WIFPOPPPP (925)
      END IF





      RETURN
      END
      SUBROUTINE INF005 (MODE,IERR)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'OPTION.INC'
      INCLUDE       'ESPACE.INC'
      INTEGER       GVFLEN, ILOOP, ISHORT, NLINES, GVFPOS, LENCOM,
     +              IPOS, I, IERR, MODE
      LOGICAL       FOUND
      CHARACTER*9   SHORTSTRING
      CHARACTER*80  COMMAND
      CHARACTER*80  BUF(MAXOPT)
      EQUIVALENCE   (BUF(1),ESPACE(60001))







      CALL ESPSET (60001,60000+80*MAXOPT/4,9)



      CALL GETWORD (COMMAND,IERR)
      IF (IERR.NE.0) GOTO 998
      LENCOM=GVFLEN(COMMAND)
      IF (LENCOM.LE.0) GOTO 998



      FOUND=.FALSE.
      CALL GVSFMT ('?M0711')



    5 CONTINUE
      DO 20 ILOOP=1,MAXMEN
         IF (GVFLEN(MEN3COD(ILOOP)).LE.0) GOTO 20
         SHORTSTRING(1:1)='?'
         SHORTSTRING(2:4)=MEN3COD(ILOOP)
         SHORTSTRING(5:9)='SHORT'
         CALL CGETTEXT (SHORTSTRING,9,BUF,NLINES,MAXOPT) 
         IF (MODE.EQ.2) THEN
            DO 8 ISHORT=1,NLINES
               IF (BUF(ISHORT)(1:5).EQ.'MORE ') GOTO 9
    8       CONTINUE
            GOTO 10
    9       CONTINUE
            SHORTSTRING(5:9)='MORE '
            CALL CGETTEXT (SHORTSTRING,8,BUF,NLINES,MAXOPT) 
         END IF
 10      CONTINUE
         DO 15 ISHORT=1,NLINES
            CALL GVSSTX (LINE2,BUF(ISHORT))
            CALL GVSCUC (LINE2)
            IPOS=GVFPOS(LINE2,COMMAND(1:LENCOM))
            IF (IPOS.NE.0) THEN
               FOUND=.TRUE.
               CALL GVSCTB (BIGLIN,132)
               WRITE (BIGLIN,FMT,ERR=15) MEN6COD(ILOOP),
     +          (BUF(ISHORT)(I:I),I=1,GVFLEN(BUF(ISHORT)))
               CALL GVSTT6 (BIGLIN)
            END IF
 15      CONTINUE
   20 CONTINUE



      IF (MODE.EQ.1.AND..NOT.FOUND) THEN
         CALL SHOWTEXT ('?R00176')
         MODE=2
         GOTO 5
      END IF
      IF (.NOT.FOUND) CALL GVST6C ('?M0710',COMMAND,.FALSE.)



      CALL ESPKIL (60001,60000+80*MAXOPT/4,9,'INF005')



  998 CONTINUE


      RETURN
      END   
      SUBROUTINE INF006 (ICHAP,IERR)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IERR, GVFPOS
      LOGICAL       INFFND, DONE
      CHARACTER*(*) ICHAP
      CHARACTER*2   CHAPNB
      CHARACTER*80  LOCTOP, LOCLIN







      INFFND=.FALSE.
      IERR=0



      CALL INF001A (ICHAP,'DUMMY',LOCTOP,IERR)
      IF (IERR.NE.0) GOTO 998





      CALL INF001B (CHAPNB,IERR)



   10 CONTINUE



         CALL GETLINE (11,LOCLIN,IERR)
         IF (IERR.EQ.1) GOTO 999
         IF (IERR.EQ.2) GOTO 100
         IF (LOCLIN(1:2).NE.CHAPNB(1:2)) GOTO 10




         IF (GVFPOS(LOCLIN,'INTRODUCTION.').NE.0) THEN



            BACKSPACE (11)
            CALL INF001C (ICHAP,CHAPNB,'Info')
            INFFND=.TRUE.
         END IF
      GOTO 10



  100 CONTINUE
      IERR=0
      IF (.NOT.INFFND) THEN
         CALL GENHELP (ICHAP,DONE)
         IF (DONE.OR.WIFPAR(925).NE.0) GOTO 998
         CALL SHOWTEXT ('?M0407')
         IERR=1
      END IF
      GOTO 998



  999 CONTINUE
      CALL GVSTTE ('?BUGG01')
      IERR=1
      CALL GVSTT6 ('IN INF006')



  998 CONTINUE


      RETURN
      END
      SUBROUTINE INF007 (TOPIC)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'OPTION.INC'
      INTEGER       ILOOP, GVFLEN
      LOGICAL       INTERRUPTED
      CHARACTER*(*) TOPIC







      IF (GVFLEN(TOPIC).LE.0) GOTO 998




      CALL WIFPUSHPPP (925,1)



      DO 10 ILOOP=1,MAXMEN
         IF (INTERRUPTED()) GOTO 100
         IF (GVFLEN(MENCHAP(ILOOP)).NE.0) THEN
            CALL INF004 (MENCHAP(ILOOP),TOPIC)
            IF (WIFPAR(1065).EQ.0) GOTO 100
         END IF
   10 CONTINUE



  100 CONTINUE
      CALL WIFPOPPPP (925)



  998 CONTINUE


      RETURN
      END   
      SUBROUTINE WIF016 (TEXT)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       GVFLEN, LENAME, IERR
      CHARACTER*(*) TEXT
      CHARACTER*80  LOCLIN







      IF (GVFLEN(TEXT).EQ.0) THEN



   10    CONTINUE
         LENAME=GVFLEN(FILNMS(16))
         IF (LENAME.EQ.0) THEN
            CALL IPROMPT ('?M0026')
         ELSE
            LENAME=LENAME+1
            CALL GVSCTB (LOCLIN,80)
            CALL GVSCC3 (LOCLIN,'NAME (',FILNMS(16),') ')
            CALL IPROMPT (LOCLIN(1:GVFLEN(LOCLIN)))
         END IF



         CALL GETWORD (LINE2,IERR)
         IF (IERR.EQ.1) GOTO 998
         IF (IERR.EQ.0) CALL GVSSTX (FILNMS(16),LINE2)
         IF (GVFLEN(FILNMS(16)).EQ.0) THEN
            CALL GVSTT6 ('?NEWT846')
            GOTO 10
         END IF
      ELSE



         CALL GVSSTX (FILNMS(16),TEXT)
      END IF



      CALL GETFILN (16,' ',FILNMS(16),IERR)
      IF (IERR.NE.0) GOTO 998
      IF (WIFPAR(429).EQ.0) CALL GVSTUM (16)
      CALL GVSSTX (FILNMS(74),FILNMS(16))



      CALL GVSTO6 ('?NEWY119')
   20 CONTINUE
      CALL IPROMPT ('?M2301')
      CALL GETFULLLINE (LINE2,IERR)
      CALL GVSFMT ('?FMT111')
      IF (IERR.EQ.0) THEN
         WRITE (16,FMT,ERR=999) LINE2
         GOTO 20
      END IF



      LOGGER=.TRUE.



      CALL SETHIS ('?M2302')
      GOTO 998



  999 CONTINUE
      CALL GVSTTB ('?NEWB345')



  998 CONTINUE


      RETURN
      END
      SUBROUTINE STARTHTML (TEXT)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       GVFLEN, LENAME, IERR
      CHARACTER*(*) TEXT
      CHARACTER*80  LOCLIN







      IF (GVFLEN(TEXT).EQ.0) THEN



   10    CONTINUE
         LENAME=GVFLEN(FILNMS(16))
         IF (LENAME.EQ.0) THEN
            CALL IPROMPT ('?M0026')
         ELSE
            LENAME=LENAME+1
            CALL GVSCTB (LOCLIN,80)
            CALL GVSCC3 (LOCLIN,'NAME (',FILNMS(16),') ')
            CALL IPROMPT (LOCLIN(1:GVFLEN(LOCLIN)))
         END IF



         CALL GETWORD (LINE2,IERR)
         IF (IERR.EQ.1) GOTO 998
         IF (IERR.EQ.0) CALL GVSSTX (FILNMS(16),LINE2)
         IF (GVFLEN(FILNMS(16)).EQ.0) THEN
            CALL GVSTT6 ('?NEWT846')
            GOTO 10
         END IF
      ELSE



         CALL GVSSTX (FILNMS(16),TEXT)
      END IF



      CALL GETFILN (16,' ',FILNMS(16),IERR)
      IF (IERR.NE.0) GOTO 998
      CALL GVSSTX (FILNMS(74),FILNMS(16))



      CALL SHOWTEXTU (16,'?M2308')
      CALL GVSFMT ('?FMT684')
      WRITE (16,FMT,ERR=999)
      CALL GVSTUM (16)
      CALL GVSFMT ('?FMT685')
      WRITE (16,FMT,ERR=999)
      CALL GVSFMT ('?FMT683')
      WRITE (16,FMT,ERR=999)
      CALL GVSFMT ('?FMT684')
      WRITE (16,FMT,ERR=999)



      CALL GVSTO6 ('?NEWY119')
   20 CONTINUE
      CALL IPROMPT ('?M2301')
      CALL GETFULLLINE (LINE2,IERR)
      CALL GVSFMT ('?FMT111')
      IF (IERR.EQ.0) THEN
         WRITE (16,FMT,ERR=999) LINE2
         GOTO 20
      END IF
      CALL GVSFMT ('?FMT685')
      WRITE (16,FMT,ERR=999)
      CALL GVSFMT ('?FMT686')
      WRITE (16,FMT,ERR=999)
      CALL GVSFMT ('?FMT684')
      WRITE (16,FMT,ERR=999)



      LOGGER=.TRUE.



      CALL SETHIS ('?M2303')
      GOTO 998



  999 CONTINUE
      CALL GVSEIW ('STARTHTML')



  998 CONTINUE


      RETURN
      END
      SUBROUTINE ENDHTML

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      LOGICAL       GVFFOP







      LOGGER=.FALSE.



      IF (.NOT.GVFFOP(16)) THEN
         CALL GVSTTE ('?NEWE957')
         GOTO 998
      END IF



      CALL GVSFMT ('?FMT687')
      WRITE (16,FMT,ERR=999)
      CALL GVSFMT ('?FMT688')
      WRITE (16,FMT,ERR=999)
      CALL GVSFMT ('?FMT689')
      WRITE (16,FMT,ERR=999)



      CALL GVSCLF (16)



      CALL GVSCCC (LINE,'?M2306',FILNMS(16))
      CALL GVSTT6 (LINE)



      CALL SETHIS (LINE)
      GOTO 998



  999 CONTINUE
      CALL GVSEIW ('ENDHTML')



  998 CONTINUE


      RETURN
      END
      SUBROUTINE WIF017

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      LOGICAL       GVFFOP







      LOGGER=.FALSE.



      IF (.NOT.GVFFOP(16)) THEN
         CALL GVSTTE ('?NEWE957')
         GOTO 998
      END IF



      CALL GVSCLF (16)



      CALL GVSCCC (LINE,'?M2306',FILNMS(16))
      CALL GVSTT6 (LINE)



      CALL SETHIS (LINE)



  998 CONTINUE


      RETURN
      END
      SUBROUTINE WIF104 (OPTION,NUMBER)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      LOGICAL       GVFFOP
      INTEGER       I, J,  GVFLEN, LOCLVL, NUMBER
      PARAMETER     (LOCLVL=9)
      CHARACTER*6   OPTION(NUMBER)
      CHARACTER*8   LOCMLV







      IF (IU54.LE.0) GOTO 998



      IF (.NOT.GVFFOP(IU54)) THEN
         CALL GVSNL6 (3)
         CALL GVSFMT ('?MENU01')
         CALL GVSCTB (LINE,80)
         WRITE (LINE,FMT,ERR=999) MENULV(1)
         CALL GVSTO6 (LINE)

         CALL GVSFMT ('?MENU02')
         CALL GVSCTB (LINE,80)
         WRITE (LINE,FMT,ERR=999) MENULV(2)
         CALL GVSTO6 (LINE)

         CALL GVSFMT ('?MENU03')
         CALL GVSCTB (LINE,80)
         WRITE (LINE,FMT,ERR=999) MENULV(3)
         CALL GVSTO6 (LINE)

         CALL GVSFMT ('?MENU04')
         CALL GVSCTB (LINE,80)
         WRITE (LINE,FMT,ERR=999) MENULV(4)
         CALL GVSTO6 (LINE)

         CALL GVSFMT ('?MENU05')
         CALL GVSCTB (LINE,80)
         WRITE (LINE,FMT,ERR=999) MENULV(5)
         CALL GVSTO6 (LINE)

         CALL GVSFMT ('?MENU06')
         CALL GVSCTB (LINE,80)
         WRITE (LINE,FMT,ERR=999) MENULV(6)
         CALL GVSTO6 (LINE)

         CALL GVSFMT ('?MENU07')
         CALL GVSCTB (LINE,80)
         WRITE (LINE,FMT,ERR=999) MENULV(7)
         CALL GVSTO6 (LINE)

         CALL GVSFMT ('?MENU08')
         CALL GVSCTB (LINE,80)
         WRITE (LINE,FMT,ERR=999) MENULV(8)
         CALL GVSTO6 (LINE)

         CALL GVSFMT ('?MENU09')
         CALL GVSCTB (LINE,80)
         WRITE (LINE,FMT,ERR=999) MENULV(9)
         CALL GVSTO6 (LINE)

         CALL GVSFMT ('?MENU10')
         LOCMLV=MENULV(LOCLVL+1)
         IF (MENULV(LOCLVL+2).NE.'        ') 
     +    CALL GVSSTX (LOCMLV,'?M2304')
         CALL GVSCTB (LINE,80)
         WRITE (LINE,FMT,ERR=999) LOCMLV
         CALL GVSTO6 (LINE)



         CALL GVSFMT ('?MENU11')
         CALL GVSCTB (LINE,80)
         WRITE (LINE,FMT,ERR=999)
         CALL GVSTO6 (LINE)





         CALL GVSFMT ('?FMT522')
         DO 10 J=0,NUMBER-8,8
            CALL GVSCTB (LINE,80)
            WRITE (LINE,FMT,ERR=999) (OPTION(J+I),I=1,8)
            IF (GVFLEN(LINE).GE.1) CALL GVSTO6 (LINE)
   10    CONTINUE
      END IF



      GOTO 998



  999 CONTINUE
      CALL GVSTTB ('?M0204')
      CALL GVSKIL



  998 CONTINUE


      RETURN
      END
      SUBROUTINE DUMPOPT (TEXT)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      CHARACTER*(*) TEXT







      IF (WIFPAR(848).EQ.0) GOTO 998



      CALL GVSNL6 (1)
      CALL GVSTT6 (TEXT)
      CALL GVST6C ('?M2305',OPTINP,.TRUE.)



  998 CONTINUE


      RETURN
      END   
      SUBROUTINE SPLITOPT


















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       GVFLEN, GVFPOS, IPOS, ICOM, I
      CHARACTER*250 LOCLIN







      IF (GVFLEN(OPTINP).LE.0) GOTO 998



      CALL GVSCTB (OPTIN,6)
      CALL GVSCTB (HITEM,6)
      CALL GVSSHL (OPTINP)



      CALL GVSSTX (LOCLIN,OPTINP)
      CALL SPLITLINE (LOCLIN,OPTIN,OPTINP)



      IF (GVFPOS(OPTIN,'HELP').NE.0.OR.
     +    GVFPOS(OPTIN,'FIND').NE.0.OR.
     +    GVFPOS(OPTIN,'INFO').NE.0) THEN
         CALL GVSSTX (LOCLIN,OPTINP)
         CALL SPLITLINE (LOCLIN,HITEM,OPTINP)
         CALL GVSCUC (OPTIN)
         CALL GVSCUC (HITEM)
         GOTO 998
      END IF
      IPOS=GVFPOS(OPTINP,' ')
      IF (OPTINP(1:1).EQ.'%') THEN
         ICOM=5
      ELSE
         ICOM=6
      END IF




   10 CONTINUE
      IF (IPOS.LT.ICOM) THEN
         IPOS=IPOS+1
         DO 20 I=250,IPOS,-1
            OPTINP(I:I)=OPTINP(I-1:I-1)
   20    CONTINUE
         OPTINP(IPOS-1:IPOS-1)=' '
         GOTO 10
      END IF
      IF (OPTINP(1:1).EQ.'%') THEN
         OPTIN=OPTINP(2:7)
         HITEM=OPTINP(7:12)
      ELSE
         OPTIN=OPTINP(1:6)
         HITEM=OPTINP(6:11)
      END IF



      CALL GVSCUC (OPTIN)
      CALL GVSCUC (HITEM)
      IF (GVFLEN(OPTIN).GT.0) THEN
         IPOS=GVFPOS(OPTINP,OPTIN)
         IF (IPOS.NE.0) THEN
            DO 30 ICOM=IPOS,IPOS+GVFLEN(OPTIN)-1
               OPTINP(ICOM:ICOM)=' '
   30       CONTINUE
         END IF
      END IF



  998 CONTINUE


      RETURN
      END
      SUBROUTINE GENMEN (MENUNAME)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       GVFLEN
      CHARACTER*(*) MENUNAME







      IF (GVFLEN(MENUNAME).LE.1) THEN
         CALL GVSTTB ('?BUGG42')
         GOTO 998
      END IF



      CALL GVSSTX (LINE2,'?GENMEN')
      CALL GVSSTX (LINE2(61:80),MENUNAME)
      CALL SETHIS (LINE2)



  998 CONTINUE


      RETURN
      END   
      SUBROUTINE WIFHIS (COMAND,IERR)

























      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      CHARACTER*80  LOCLIN, TEMP, MYCOMM(100,2), TEMP2
      CHARACTER*(*) COMAND
      INTEGER       HISCNT, GVFLFI, GVFLEN, MYCCNT, GVFPOS, I, ISTART, 
     +              ILEN, IPOS, ICOMND, NUMBER, LENC, ICOM, IERR
      LOGICAL       FIRST, GVFIBN
      SAVE          FIRST, HISCNT, MYCCNT, MYCOMM
      DATA FIRST    /.TRUE./







      IF (GVFLEN(COMAND).LE.0) GOTO 999



      IF (FIRST) THEN
         FIRST=.FALSE.
         HISCNT=1
         MYCCNT=0
         CALL GVSCTB (HISROW,100*80)
         CALL GVSCTB (MYCOMM,2*100*80)
         CALL GVSSTX (HISROW(1)(1:6),'NOPREV')
      END IF



      IF (COMAND(1:2).EQ.'<<'.OR.COMAND(1:2).EQ.'>>') THEN



         IF (MYCCNT.LE.0) THEN
            CALL GVSTTE ('?BUGG29')
            CALL GVSCTB (COMAND,LEN(COMAND))
            GOTO 999
         END IF



         CALL GVSFMT ('?FMT680')
         DO 13 I=1,MYCCNT
            WRITE (LOCLIN,FMT,ERR=998)MYCOMM(I,1)(1:8),MYCOMM(I,2)(1:30)
            CALL GVSTT6 (LOCLIN)
   13    CONTINUE
         GOTO 999
      END IF



      IF (COMAND(1:1).EQ.'>') THEN



         IF (MYCCNT.EQ.100) THEN
            CALL GVSTTE ('?BUGG27')
            GOTO 999
         END IF



         DO 15 I=1,249
            COMAND(I:I)=COMAND(I+1:I+1)
   15    CONTINUE
         COMAND(250:250)=' '
         IPOS=GVFPOS(COMAND,'>')



         IF (IPOS.EQ.0) THEN
            CALL GVSTTE ('?BUGG28')
            GOTO 999
         END IF



         ILEN=GVFLEN(COMAND)
         IF (IPOS.EQ.ILEN) THEN
            CALL GVSTTE ('?BUGG28')
            GOTO 999
         END IF



         MYCCNT=MYCCNT+1
         MYCOMM(MYCCNT,1)(1:IPOS-1)=COMAND(1:IPOS-1)
         MYCOMM(MYCCNT,2)(IPOS+1-IPOS:ILEN-IPOS)=COMAND(IPOS+1:ILEN)
         CALL GVSCUC (MYCOMM(MYCCNT,2))
         CALL GVSTT6 ('?NEWCDE')
         GOTO 999
      END IF



      IF (COMAND(1:1).EQ.'<') THEN



         IF (MYCCNT.LE.0) THEN
            CALL GVSTTE ('?BUGG29')
            GOTO 999
         END IF



         DO 116 I=1,249
            COMAND(I:I)=COMAND(I+1:I+1)
  116    CONTINUE
         COMAND(250:250)=' '
         CALL GVSCUC (COMAND)
         ILEN=GVFLEN(COMAND)



         DO 16 I=1,MYCCNT
            IF (MYCOMM(I,2)(1:ILEN).EQ.COMAND(1:ILEN)) THEN
               COMAND=MYCOMM(I,1)



               HISCNT=HISCNT+1



               IF (HISCNT.GE.100) THEN
                  DO 10 ICOMND=1,99
                     HISROW(ICOMND)=HISROW(ICOMND+1)
   10             CONTINUE
                  HISCNT=100
               END IF



               CALL GVSSTX (HISROW(HISCNT),COMAND(1:80))
               IERR=0
               GOTO 997
            END IF
   16    CONTINUE



         CALL GVSTTE ('?BUGG30')
         GOTO 999
      END IF



      IF (COMAND(1:1).NE.'!'.AND.COMAND(1:1).NE.'.') THEN
         HISCNT=HISCNT+1



         IF (HISCNT.GE.100) THEN
            DO 11 ICOMND=1,99
               CALL GVSSTX (HISROW(ICOMND),HISROW(ICOMND+1))
   11       CONTINUE
            HISCNT=100
         END IF



         CALL GVSSTX (HISROW(HISCNT),COMAND(1:80))



      ELSE



         IF (COMAND(1:2).EQ.'!!'.OR.COMAND(1:2).EQ.'..') THEN
            CALL GVSSTX (COMAND,HISROW(HISCNT))



         ELSE IF (COMAND(2:3).EQ.'P '.OR.COMAND(2:5).EQ.'SHOW'.OR.
     +       COMAND(2:3).EQ.'p '.OR.COMAND(2:5).EQ.'show') THEN
            CALL GVSFMT ('?FMT690')
            DO 400 ISTART=1,HISCNT,5
               WRITE (LOCLIN,FMT,ERR=998)
     +          (ICOMND,HISROW(ICOMND)(1:6),ICOMND=ISTART,
     +          MIN(HISCNT,ISTART+4))
               CALL GVSTT6 (LOCLIN)
  400       CONTINUE
            GOTO 999



         ELSE IF (GVFLFI(1,NUMBER,COMAND).EQ.0) THEN



            CALL GVSSTX (TEMP,COMAND(2:))
            CALL GVSCUC (TEMP)
            LENC=GVFLEN(TEMP)
            IF (LENC.GE.1) THEN
               IF (.NOT.GVFIBN(HISCNT,1,100)) THEN
                  CALL GVSTTB ('?BUGG31')
                  CALL GVSTTI ('HISCNT=',HISCNT)
                  GOTO 999
               END IF
               DO 30 ICOM=HISCNT,1,-1
                  CALL GVSSTX (TEMP2,HISROW(ICOM)(1:LENC))
                  CALL GVSCUC (TEMP2)
                  IF (TEMP(1:LENC).EQ.TEMP2(1:LENC)) THEN
                     CALL GVSSTX (COMAND,HISROW(ICOM))
                     CALL GVSTT6 (COMAND)
                     IERR=0
                     GOTO 997
                  END IF
   30          CONTINUE
            END IF
            CALL GVSTTE ('?BUGG32')
            GOTO 999



         ELSE
            IF (.NOT.GVFIBN(NUMBER,1,HISCNT)) THEN
               CALL GVSTTE ('?BUGG32')
               GOTO 999
            END IF



            CALL GVSSTX (COMAND,HISROW(NUMBER))
         END IF
      END IF
      IERR=0
      GOTO 997



  999 CONTINUE
      IERR=1
      CALL GVSCTB (COMAND,LEN(COMAND))
      GOTO 997



  998 CONTINUE
      CALL GVSEIW ('WIFHIS')
      GOTO 999



  997 CONTINUE


      RETURN
      END
      SUBROUTINE WIFWCM (COMAND,IERR)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      CHARACTER*(*) COMAND
      INTEGER       IERR, I, GVFPOS, GVFLEN







      IF (GVFLEN(COMAND).LE.0) THEN
         IERR=1
         GOTO 998
      END IF



      IERR=1



      DO 100 I=1,100
         IF (GVFPOS(HISROW(I),COMAND).NE.0) THEN
            IERR=0
            GOTO 998
         END IF
 100  CONTINUE



 998  CONTINUE


      RETURN
      END   
      SUBROUTINE WIFPCT (DONE)





















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IERR, GVFLEN
      LOGICAL       DONE
      CHARACTER*10  LOCOPTIN







      DONE=.FALSE.
      IERR=0



      CALL GVSSHL (OPTINP)
      IF (OPTINP(1:1).NE.'%') GOTO 998



      CALL GVSCTB (LOCOPTIN,10)
      CALL GETWORD (LOCOPTIN,IERR)
      IF (IERR.NE.0) GOTO 998
      IF (GVFLEN(LOCOPTIN(2:10)).GT.6) THEN
         CALL GVST6C ('?M0733',LOCOPTIN(2:10),.TRUE.)
      END IF
      CALL GVSSTX (OPTIN,LOCOPTIN(2:7))
      CALL GVSCUC (OPTIN)



      IF (.NOT.DONE) CALL MEN001 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN002 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN003 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN004 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN005 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN006 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN007 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN008 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN009 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN010 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN011 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN012 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN013 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN014 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN015 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN016 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN017 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN018 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN019 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN020 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN021 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN022 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN023 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN024 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN025 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN026 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN027 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN028 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN029 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN030 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN031 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN032 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN033 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN034 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN035 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN036 (OPTIN,DONE)

      IF (.NOT.DONE) CALL MEN038 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN039 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN040 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN041 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN042 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN043 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN044 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN045 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN046 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN047 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN048 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN049 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN050 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN051 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN052 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN053 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN054 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN055 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN056 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN057 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN058 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN059 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN060 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN061 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN062 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN063 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN064 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN065 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN066 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN067 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN068 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN069 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN070 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN071 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN072 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN074 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN075 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN076 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN077 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN078 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN079 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN080 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN081 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN082 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN083 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN084 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN085 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN087 (OPTIN,DONE)
      IF (.NOT.DONE) CALL MEN099 (OPTIN,DONE)



  998 CONTINUE


      RETURN
      END
      SUBROUTINE BADHELP (HITEMIN)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      CHARACTER*(*) HITEMIN







      IF (LEN(HITEMIN).LT.1) THEN
         CALL GVSBOX ('?BUGG34')
         GOTO 998
      END IF



      CALL GVSSTX (LINE2,'?BUGG35')
      CALL GVSSTX (LINE2(70:80),HITEMIN)
      CALL GVSBOX (LINE2)



  998 CONTINUE


      RETURN
      END
      SUBROUTINE BADINFO (HITEMIN)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      CHARACTER*(*) HITEMIN







      IF (LEN(HITEMIN).LT.1) THEN
         CALL GVSBOX ('?BUGG36')
         GOTO 998
      END IF



      CALL GVSSTX (LINE2,'?BUGG37')
      CALL GVSSTX (LINE2(70:80),HITEMIN)
      CALL GVSBOX (LINE2)



  998 CONTINUE


      RETURN
      END
      SUBROUTINE GETOPT (TEXT,IERR)

















      IMPLICIT      NONE
      INCLUDE       'ESPACE.INC'
      INCLUDE       'OPTION.INC'
      INTEGER       IERR, I, IOPT, NLINES, GVFLEN
      CHARACTER*80  BUF(MAXOPT)
      CHARACTER*(*) TEXT
      CHARACTER*(12) LOCTXT 
      EQUIVALENCE   (BUF(1),ESPACE(60001))







      CALL ESPSET (6001,6001+80*MAXOPT/4,27)



      CALL GVSCTB (BUF,MAXOPT*80)
      CALL GVSCTB (OPTION,6*MAXOPT)
      IOPT=0
      IERR=0



      I=GVFLEN(TEXT)
      LOCTXT='?'
      DO 20 I=1,MIN(11,GVFLEN(TEXT))
         LOCTXT(I+1:I+1)=TEXT(I:I)
  20  CONTINUE
      I=GVFLEN(LOCTXT)
      CALL OPENUNIT88
      CALL CGETTEXT (LOCTXT(1:I),I,BUF,NLINES,MAXOPT) 

      DO 10 I=1,NLINES
         IF (BUF(I)(1:6).EQ.'      ') THEN
            IOPT=(IOPT+7)/8*8
         ELSE IF (BUF(I)(1:6).EQ.'MORE  ') THEN
            IOPT=(IOPT+8)/8*8
            CALL GVSSTX (OPTION(IOPT),BUF(I)(1:6))
         ELSE
            IOPT=IOPT+1
            CALL GVSSTX (OPTION(IOPT),BUF(I)(1:6))
         END IF
   10 CONTINUE



      CALL ESPKIL (6001,6001+80*MAXOPT/4,27,'GETOPT')





      RETURN
      END   

      SUBROUTINE LOPPDB (ETCALL,IERR)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IUNIT, IERR
      CHARACTER*4   PDBID
      LOGICAL       INTERRUPTED
      EXTERNAL      ETCALL







      IERR=0



      CALL GVSROF (IUNIT,IERR)
      IF (IUNIT.EQ.0.OR.IERR.NE.0) GOTO 998
      CALL GETFILE (IUNIT,' ','FILES.LIST',IERR)
      IF (IERR.NE.0) GOTO 998



   10 CONTINUE
         CALL GVSFMT ('?FMT020')
         READ (IUNIT,FMT,END=100,ERR=100) PDBID
         IF (INTERRUPTED()) GOTO 998
         CALL GVST6C ('?WORKON',PDBID,.TRUE.)



         CALL SYMINI
         CALL WIF080
         CALL MOL100



         CALL GVSSHL (PDBID)
         CALL GVSSTX (FILNMS(80),PDBID)
         CALL GVSSHL (FILNMS(80))



         CALL MOL013 (PDBID,IERR)
         IF (IERR.NE.0.OR.NUMAAF.LE.0) THEN
            CALL GVST6C ('?M0471',PDBID,.TRUE.)
            IERR=1
            GOTO 998
         END IF



         CALL SHOSOU



         CALL ETCALL
      GOTO 10



  100 CONTINUE



  998 CONTINUE


      RETURN
      END   
      SUBROUTINE LPDTST

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'







      CALL SHOSOU
      CALL SHOIAA (1)
      CALL SHOIAA (NUMAAF)





      RETURN
      END   
