	FUNCTION RPRMPT (BPRMPT,RMIN,RMAX,RDEFLT)
C PRINT PROMPT BPRMPT AND EXPECT AN INTEGER RESPONSE BETWEEN IMIN AND IMAX
C WITH A DEFAULT VALUE OF IDEFLT
C
C	BPRMPT		PROMPT PRINTED ON THE TERMINAL
C	RMIN		MINIMUM VALUE ALLOWED TO BE INPUT
C	RMAX		MAXIMUM VALUE ALLOWED TO BE INPUT
C		IF RMIN=RMAX THEY ARE IGNORED
C	RDEFLT		DEFAULT VALUE IS DEFINED
C
	IMPLICIT BYTE (B), LOGICAL*1 (L)
	DIMENSION BPRMPT(1),BUF(27)
5	IL = IBLEN (BPRMPT)
	WRITE (5,10) (BPRMPT(I),I=1,IL)
10	FORMAT ('$',80A1)
C PROCESS LIMITS
	LIM = RMIN .NE. RMAX
	IF (.NOT. LIM) GOTO 40
	ENCODE (27,20,BUF) RMIN,RMAX
20	FORMAT ('(',G12.5,',',G12.5,')')
	CALL BSQZ(BUF,27,IL)
	WRITE (5,30) ' ',(BUF(I),I=1,IL)
30	FORMAT ('+',$,27A1)
C PROCESS DEFAULT VALUE
40	LDEF = .TRUE.
	IF (.NOT. LDEF) GOTO 60
	ENCODE (14,50,BUF) RDEFLT
50	FORMAT ('[',G12.5,']')
	CALL BSQZ (BUF,14,IL)
	WRITE (5,30) ' ',(BUF(I),I=1,IL)
C FINISH PROMPT
60	WRITE (5,30) ':',' '
	READ (5,70,ERR=75) IN,RPRMPT
70	FORMAT (Q,E12.0)
	IF ((IN .EQ. 0) .AND. LDEF) RPRMPT = RDEFLT
C CHECK LIMITS
	IF (.NOT. LIM) RETURN
	LOUT = (RPRMPT .LT. RMIN) .OR. (RPRMPT .GT. RMAX)
	IF (.NOT. LOUT) RETURN
75	WRITE (5,80) 7,7,7
80	FORMAT (1X,3A1,'VALUE OUTSIDE LIMITS')
	GOTO 5
	END
