**==questchar.spg  processed by SPAG 4.50J  at 14:50 on 30 Jun 1995
      SUBROUTINE QUESTCHAR(Text,Flag,Endflag,Char)
      IMPLICIT NONE
C---  Prints out the characterstring on the default terminal
C---   unit, then accepts a single character response.  If the
C---   returned char is blank (as it would be if the response were
C---   a carriage return) or a slash, then char is used as default.
C---   If the input is ^Z then the returned value of endflag is .true.,
C---   otherwise it is .false..  If the input character
C---   is 'Y', the returned value of quest is .TRUE..
C---   If 'N', the returned value is .FALSE..
C---   Any other value will print out a message and ask the question
C---   again.
C--- text	I C*(*)	input character string, ending in
C---   				a null char (hex 00)
C--- defalt	I C*1	- input default character
C---
      CHARACTER*1 q , Char
      CHARACTER*(*) Text
      LOGICAL*4 Flag , Endflag
C---
      Endflag = .FALSE.
 100  WRITE (*,99001) Text , Char
      READ (*,99002,END=200) q
      IF ( (q.EQ.' ') .OR. (q.EQ.'/') ) q = Char
      IF ( (q.EQ.'Y') .OR. (q.EQ.'y') ) THEN
         Char = q
         Flag = .TRUE.
         RETURN
      ELSEIF ( (q.EQ.'N') .OR. (q.EQ.'n') ) THEN
         Char = q
         Flag = .FALSE.
         RETURN
      ENDIF
      WRITE (*,*) ' Please answer Y or N'
      GOTO 100                  !Go back for another try
c
 200  Endflag = .TRUE.
      RETURN
99001 FORMAT ('$',A,' ('A,')? ')
99002 FORMAT (a1)
      END
