	SUBROUTINE SEELEM (BPRMPT,IELMAP,LELAST)
C PROMPT FOR ELEMENTS AND SET THE CORRESPONDING BITS IN THE ELEMENT
C MAP
C
C	BPRMPT		PROMPT PRINTED ON SCREEN
C	IELMAP		RETURNED ELEMENT MAP
C	LELAST		FLAG, IF TRUE THE LAST ELEMENT # IS SAVED
C
C	CALLED BY:	SEDILG
C	CALLS:		SEEMAP,SEENUM
C
	INCLUDE 'SEARCH.INC'
	INTEGER*2 SEENUM
	DIMENSION IELMAP(6),BLINE(80),BELEM(2),BPRMPT(1)
	EQUIVALENCE (BELEM,IELEM)
	DATA BDASH/'-'/, BCOLON/':'/
	LEND = .FALSE.			!FLAG FOR END OF INPUT
	IELEM = IBLANK			!SET TO '  '
C PROMPT FOR ELEMENTS
	WRITE (ILUO,10) (BPRMPT(I),I=1,IBLEN(BPRMPT))
10	FORMAT (' PLEASE ENTER ',60A1)
	WRITE (ILUO,20)
20	FORMAT (' WHEN YOU ARE FINISHED TYPE A '' :'' ')
30	WRITE (ILUO,35)
35	FORMAT ('$*')
C READ THE ELEMENTS
	READ (ILUI,40) IN,(BLINE(I),I=1,IN)
40	FORMAT (Q,79A1)
C SET END FLAG IF COLON WAS FOUND
	IF (BLINE(IN) .EQ. BCOLON) THEN
	  BLINE(IN) = BLANK
	  LEND = .TRUE.
	END IF
	BLINE(IN+1) = BLANK			!TERMINATE LINE WITH A BLANK
	LDASH = .FALSE.				!RANGE FLAG
	INUM = 0				!ELEMENT # OF FIRST ELEMENT
	INUM2 = 0				!ELEMENT # OF LAST ELEMENT
	IF (LELAST) IELAST = 0			!HIGHEST # ENTERED
	IE = 0					!# CHAR IN SYMBOL (1 OR 2)
	DO 100 I=1,IN+1
	  IF ((BLINE(I).GE. BSA) .AND. (BLINE(I).LE.BSZ)) 
     *		    BLINE(I) = BLINE(I) .AND. "137	!CONVERT TO UPPER CASE
C TEST FOR LETTER, IF SO STORE IN TEMP BUFFER
	  IF ((BLINE(I).GE. BA) .AND. (BLINE(I).LE.BZ)) THEN
	      IF (IE .EQ. 2) GOTO 200	!ERROR, TWO MANY LETTER IN SYMBOL
	      IE = IE + 1			!COUNT # LETTER IN SYMBOL
	      BELEM(IE) = BLINE(I)
C A CHARACTER OTHER THAT A LETTER IS THE SYMBOL DELIMITER
	  ELSE IF (IE .GT. 0) THEN
	    IF (BLINE(I) .EQ. BLANK) THEN
	      INUM = SEENUM (IELEM,IE)	!DETERMINE ELEM # AND SET IE=0
	      IF (INUM .EQ. 0) GOTO 200		!SKIP IF INVALID
	      IF (.NOT. LDASH) INUM2 = INUM	!FOR RANGES SET INUM2
	      IF (INUM2 .GT. INUM) GOTO 200	!MAKE SURE ORDER IS CORRECT
C SAVE THE LAST ELEMENT # IF REQUIRED
	      IF (LELAST .AND. (INUM .GT. IELAST)) IELAST = INUM
C SET THE ELEMENT BIT FOR ALL SYMBOLS IN THE RANGE INUM2 TO INUM
	      DO 50 J=INUM2,INUM
	        JNUM = J
50	        CALL SEEMAP (IELMAP,JNUM)	!SET THE BIT
	      LDASH = .FALSE.			!CLEAR RANGE FLAG
C IF A - IS FOUND, FIND THE OTHER SYMBOL TO DETERMINE THE RANGE
	    ELSE IF (BLINE(I) .EQ. BDASH) THEN
	      INUM2 = SEENUM (IELEM,IE) 	!DETERMINE ELEM # AND SET IE=0
	      IF (INUM2 .EQ. 0) GOTO 200	!INVALID SYMBOL
	      LDASH = .TRUE.			!SET RANGE FLAG
	    END IF
	  END IF
100	  CONTINUE
	IF (LEND) RETURN			!FINISHED
	GOTO 30
200	WRITE (ILUO,210)
210	FORMAT (' ERROR DETECTED IN LINE, PLEASE REENTER LINE')
	GOTO 30
	END
