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