c Before use, must define HELP database in RIM
c   DEFINE HELPDB
c   OWNER NONE
c   ATTRIBUTES
c   KEY3 TEXT 3
c   VERBAGE TEXT VAR
c   COMMAND TEXT 20
c   RELATIONS
c   HELP WITH KEY3 VERBAGE COMMAND
c   END
c   EXIT
c
c THEN run this. To compile, first append all the RIM sources
c except the main program.
c
      PROGRAM HELPIN(tape=24,err=1)
      INTEGER*4 TUPLE(28)
	Character*4 ctuple(28)
	Equivalence (ctuple(1),tuple(1))
	INTEGER*4 HENDC,HENDD
	CHARACTER*4 CHENDC,CHENDD
	EQUIVALENCE(HENDC,CHENDC),(HENDD,CHENDD)
      REAL*8 DBNAME
      REAL*8 RNAME
	CHARACTER*8 CRNAME,CDBNAM
	EQUIVALENCE(CRNAME,RNAME),(CDBNAM,DBNAME)
	DATA CHENDC/'ENDC'/,CHENDD/'ENDD'/
      CDBNAM = 'HELPDB'
      CRNAME = 'HELP'
      CALL RMOPEN(DBNAME)
      CALL RMFIND(1,RNAME)
      TUPLE(2) = 8
	OPEN(2,FILE='HELPTXT.DAT',STATUS='OLD')
    1 CONTINUE
      READ (2,10)TUPLE(1)
   10 FORMAT(A4)
      READ (2,20)(TUPLE(I),I=3,7)
   20 FORMAT(5A4)
   50 CONTINUE
      TUPLE(9) = 0
      CALL GETL(TUPLE(10),TUPLE(8))
C      IF(TUPLE(10).EQ.HENDC) GOTO 1
C      IF(TUPLE(10).EQ.HENDD) GOTO 1000
      IF(cTUPLE(10).EQ.'ENDC') GOTO 1
      IF(cTUPLE(10).EQ.'ENDD') GOTO 1000
C *** DEBUG
	WRITE(9,6700)TUPLE(10),TUPLE(10)
6700	FORMAT(1X,' TUPLE=',A4,' HEX=',I12)
c	IF(TUPLE(10).EQ.1128549957)GOTO 1
c	IF(TUPLE(10).EQ.1145327173)GOTO 1000
C ***
      CALL RMLOAD(1,TUPLE)
      GO TO 50
 1000 CONTINUE
      CALL RMCLOS
      STOP
      END
