PROMPTDFILE()

Fortran version:

    INTEGER FUNCTION  PROMPTDFILE( PROMPT, RDONLY, FMTTED, RECLEN, 
   &                               DEFAULT, CALLER )
      CHARACTER*(*), INTENT(IN   ) :: PROMPT         !  prompt for user
      LOGICAL      , INTENT(IN   ) :: RDONLY         !  TRUE iff file is input-only
      LOGICAL      , INTENT(IN   ) :: FMTTED         !  TRUE iff file should be formatted
      INTEGER      , INTENT(IN   ) :: RECLEN         !  record length
      CHARACTER*(*), INTENT(IN   ) :: DEFAULT        !  default logical file name
      CHARACTER*(*), INTENT(IN   ) :: CALLER         !  caller-name for logging messages

C version: none

Summary:

For interactive use -- not for modeling nor for programs that will be driven by scripts! For modeling or script driven programs, use GETDFILE(), instead.

Prompts user for logical file name, then opens the Fortran direct access file associated with it, for read-only or not, formatted or not, as indicated by RDONLY and FMTTED, and with the indicated record length RECLEN.

If environment variable PROMPTFLAG is set to "N", returns unit number associated with logical name contained in DEFAULT without prompting the user.

Logs the value returned, for tracking and validation purposes.

Returns

For Fortran-90 declarations and interface checking:

    USE M3UTILIO
    

See also:

GETDFILE(),
GETEFILE(),
PROMPTFFILE(), and
PROMPTMFILE().

Preconditions:

setenv <lname> <pathname> for the file before program launch.

Fortran Usage:

Suppose you want to open a "foo"-file as direct access read-only formatted, with record length 529, from subroutine MYSUB():
    ...
    USE M3UTILIO
    ...
    INTEGER   FOODEV, BARDEV, QUXDEV
    ...
    FOODEV = PROMPTDFILE( 'Enter name for foo-file', 
   &                      .TRUE., .TRUE., 529,
   &                      'FOO', 'MYSUB' )
    IF ( FOODEV .LT. 0 ) THEN
        ... error opening foo-file:  deal with it
    END IF
    ...


Previous: POLY

Next: PROMPTFFILE

Up: Utility Routines

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