GETREAL()

Fortran version:

    REAL FUNCTION GETREAL( LO , HI , DEFAULT , PROMPT )
        REAL            LO      ! Minimum allowed return value
        REAL            HI      ! Maximum allowed return value
        REAL            DEFAULT ! Default return value
        CHARACTER*(*)   PROMPT  ! Prompt for user

NO C version:

Summary:

Display the PROMPT to standard output for an integer between LO and HI, get the user's response and check that it is within range. Return DEFAULT if the user hits <RET>. Reprompts on error for up to 5 attempts; exits in case of more than 5 entry errors. If environment variable PROMPTFLAG is set to "N", returns DEFAULT without prompting the user. Logs the value returned, for tracking and validation purposes.

The default is displayed in square brackets at the end of the prompt [LIKE THIS]

See also GETDBLE() , GETMENU() , GETNUM() , GETSTR() , and GETYN() .

Preconditions:

none

Fortran Usage:

For Fortran-90 declarations and interface checking:
    USE M3UTILIO
    

(See sample programs LATLON or PRESZ for additional usage examples.)

    ...
    REAL           X
    REAL           GETREAL
    ...
    X = GETREAL( 0.0, 10.0, 7.5, 'Give me a number between 0.0 and 10.0' )
    ...

C Usage:

don't


Previous: GETNUM

Next: GETSTR

Up: Utility Routines

To: Models-3/EDSS I/O API: The Help Pages