Run-Time Environment Variables

The Visual Fortran run-time system recognizes the following environment variables:

Environment Variable Description
FOR_ACCEPT The ACCEPT statement does not include an explicit logical unit number. Instead, it uses an implicit internal logical unit number and the FOR_ACCEPT environment variable. If FOR_ACCEPT is not defined, the code ACCEPT f,iolist reads from CONIN$ (standard input). If FOR_ACCEPT is defined (as a filename optionally containing a path), the specified file would be read.
FORT_BUFFERED Lets you request that buffered I/O should be used at run-time for output of all Fortran I/O units, except those with output to the terminal. This provides a run-time mechanism to support the /assume:buffered_io compiler option.
FOR_DEFAULT_PRINT_DEVICE Lets you specify the print device other than the default print device PRN (LPT1) for files closed (CLOSE statement) with the DISPOSE='PRINT' specifier. To specify a different print device for the file associated with the CLOSE statement DISPOSE='PRINT' specifier, set the environment variable FOR_DEFAULT_PRINT_DEVICE to any legal DOS print device before executing the program.
FOR_DIAGNOSTIC_LOG_FILE If set to the name of a file, writes diagnostic output to the specified file. For information on using stack trace information, see Locating Run-Time Errors and Using Traceback Information.
FOR_DISABLE_DIAGNOSTIC_DISPLAY If set to true, disables the display of all error information. This might be helpful if you just want to test the error status of your program and do not want the Fortran run-time system to display any information about an abnormal program termination. For information on using stack trace information, see Using Traceback Information.
FOR_DISABLE_STACK_TRACE If set to true, disables the call stack trace information that follows the displayed severe error message text. For information on locating the cause of run-time errors using stack trace information, see Locating Run-Time Errors and Using Traceback Information.
FOR_ENABLE_VERBOSE_STACK_TRACE If set to true, displays more detailed call stack information in the event of an error. For information on using stack trace information, see Using Traceback Information.
FOR_FULL_SRC_FILE_SPEC By default, the traceback output displays only the file name and extension in the source file field. To display complete file name information including the path, set the environment variable FOR_FULL_SRC_FILE_SPEC to true. For more information, see Using Traceback Information.
FOR_GENERATE_DEBUG_EXCEPTION In Visual Fortran Version 6, you no longer need to set this environment variable for the program to stop in the debugger when a severe error occurs. Regardless of whether this environment variable is set, you can view the Call Stack display. For more information, see Locating Run-Time Errors in the Debugger.
FOR_IGNORE_EXCEPTIONS If set to true, disables the default run-time exception handling, for example, to allow just-in-time debugging. The run-time system exception handler returns EXCEPTION_CONTINUE_SEARCH to the operating system, which looks for other handlers to service the exception. For information on just-in-time debugging, see Running Fortran Applications and the Visual C++ Development Environment User's Guide.
FOR_NOERROR_DIALOGS If set to true, disables the display of dialog boxes when certain exceptions or errors occur. This is useful when running many test programs in batch mode to prevent a failure from stopping execution of the entire test stream.
FOR_PRINT Neither the PRINT statement nor a WRITE statement with an asterisk (*) in place of a unit number includes an explicit logical unit number. Instead, both use an implicit internal logical unit number and the FOR_PRINT environment variable. If FOR_PRINT is not defined, the code PRINT f,iolist or WRITE (*,f) iolist writes to CONOUT$ (standard output). If FOR_PRINT is defined (as a filename optionally containing a path), the specified file would be written to.
FOR_READ A READ statement that uses an asterisk (*) in place of a unit number does not include an explicit logical unit number. Instead, it uses an implicit internal logical unit number and the FOR_READ environment variable. If FOR_READ is not defined, the code READ (*,f) iolist or READ f,iolist reads from CONIN$ (standard input). If FOR_READ is defined (as a filename optionally containing a path), the specified file would be read.
FOR_RUN_FLAWED_PENTIUM If set to true, allows the continuation of the executing program when /check:flawed_pentium (default) is in effect and a flawed Pentium chip is detected. For more information, see Intel Pentium Floating-Point Flaw.
FOR_TYPE The TYPE statement does not include an explicit logical unit number. Instead, it uses an implicit internal logical unit number and the FOR_TYPE environment variable. If FOR_TYPE is not defined, the code TYPE f,iolist writes to CONOUT$ (standard output). If FOR_TYPE is defined (as a filename optionally containing a path), the specified file would be written to.
FORTn Lets you specify the file name for a particular unit number (n), when a file name is not specified in the OPEN statement or an implicit OPEN is used, and the compiler option /fpscomp:filesfromcmd was not specified. Preconnected files attached to units 0, 5, and 6 are by default associated with system standard I/O files.
FORT_CONVERTn Lets you specify the data format for an unformatted file associated with a particular unit number (n), as described in Methods of Specifying the Data Format.
FORT_CONVERT.ext
FORT_CONVERT_ext
Lets you specify the data format for unformatted files with a particular file extension suffix (ext), as described in Methods of Specifying the Data Format.

On the command line, the SET command lets you:

From within your program, you can set the appropriate environment variable by calling the SETENVQQ routine:

  program ENVVAR
  use dflib
  LOGICAL(4) res
  ! Add other data declarations here
  ! call SETENVQQ as a function
  res=SETENVQQ("FOR_GENERATE_DEBUG_EXCEPTION=T")
  ...

For a list of environment variables used with the DF command, see Environment Variables Used with the DF Command.