GETYN()

Fortran version:

    LOGICAL FUNCTION GETYN( PROMPT , DEFAULT )
        CHARACTER*(*)   PROMPT  ! Prompt for user
        LOGICAL         DEFAULT ! Default return value

NO C version:

Summary:

Display the PROMPT to standard output for YES or NO, get the user's response and check that its first character, after upcasing, is 'Y' or 'N'. If 'Y', returns TRUE; if 'N', FALSE. 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 like this: [Y].

See also GETNUM() , GETMENU() , GETREAL() , and GETDBLE() ,

Preconditions:

none

Fortran Usage:

For Fortran-90 declarations and interface checking:
    USE M3UTILIO
    

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

    ...
    LOGICAL        L
    LOGICAL        GETYN
    ...
    L = GETYN( 'Give me a YES or NO', .TRUE )
    IF ( .NOT. GETYN( 'Continue?', L ) ) CALL M3EXIT( 0 )
    ...

C Usage:

don't


Previous: GETSTR

Next: GRIDOPS

Up: Utility Routines

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