C******************** START FILE UREADF.FOR ; GROUP UREADT ******************
C---------------------------------------------------------------
C  UREADT
C
C  COLLECTION OF SUBROUTINES TO USE UREAD TO GET DATA OF
C  VARIOUS TYPES FROM THE TTY
C
C   UREADF - GET A FLOATING PT NUMBER
C   UREADI - GET AN INTEGER
C   UREADC - GET A CHARACTER
C   UREADW - GET A WORD (MAX LENGTH DETERMINED BY PASSED CHARACTER
C                        ARGUMENT, SPACE OR COMMA DELIMITTED)
C   UREADL - GET A LINE (MAX LENGTH DETERMINED BY PASSED CHARACTER
C                        ARGUMENT)
C
C  EACH ROUTINE IS CALLED VIA
C    CALL UREAD_('PROMPT STRING $-TERMINATED',ARGUMENT RETURNED)
C
C  THE PROMPT STRING MUST BE $-TERMINATED
C
C  FOR UREADI AND UREADF,
C  THE ARGUMENT VALUE IS A DEFAULT WHICH CAN BE KEPT BY THE USER
C  TYPING "Q" OR "X" OR "," IN RESPONSE TO THE PROMPT
C
C  FOR UREADC AND UREADW,
C  THE ARGUMENT VALUE IS A DEFAULT WHICH CAN BE KEPT BY THE USER
C  TYPING "," IN RESPONSE TO THE PROMPT
C
C  UREADL DOES NOT RECOGNIZE A DEFAULT-- USER MUST TYPE A NEW LINE
C----------------------------------------------------------
C& UREADF  ISSUE UREAD PROMPT, RETURN FLOATING PT NUMBER
C
      SUBROUTINE UREADF(PROMPT,F)
C
      USE USERIO
C
      CHARACTER*(*) PROMPT
      REAL F
C
      IF(NLXOUT) WRITE(LUNTRM,1001) F
 1001 FORMAT(' [OLD VALUE:  ',1PE12.5,']')
C  SAVE DEFAULT VALUE
      ZF=F
C
 10   CONTINUE
C  RESTORE DEFAULT VALUE AFTER ERROR
      F=ZF
C
      CALL UREAD(PROMPT)
C
C  ACCEPT DEFAULT (OLD VALUE)?
      IDFLT=IXUOPC('QX,$')
      IF(IDFLT.NE.0) THEN
        IF(NLXOUT) WRITE(LUNTRM,1002)
 1002 FORMAT(' % OLD VALUE RETAINED')
        GO TO 20
      ENDIF
C
      F=FDCOD(IER)
      IF(IER.NE.0) GO TO 10
C
 20   CONTINUE
      RETURN
      END
C******************** END FILE UREADF.FOR ; GROUP UREADT ******************
