DOCERR: Reference Manual Sample Produces Incorrect Results
PSS ID Number: Q11753
Article last modified on 04-05-1994

3.31

MS-DOS


----------------------------------------------------------------------
The information in this article applies to:

 - Microsoft FORTRAN for MS-DOS, version 3.31
----------------------------------------------------------------------

Summary:

SYMPTOMS
   An attempt to run the example program on page 110 of the Microsoft
   FORTRAN "Reference" manual for version 3.31 fails. The first
   character of the write statement is lost and the program prints the
   following on the screen:

      utput filename?:

CAUSE
   The code example is incorrect. The first character of an output
   statement that uses unit 0, unit *, or the PRN, LPT1, or CON files
   is not printed or stored; it is interpreted as a carriage-control
   character.

RESOLUTION
   Correct the line in the code example to read as follows:

      write(*, '(1x, A\)') 'Output filename?:'

More Information:

The following code example presents the corrected code.

Sample Code
-----------

C Compile options: None

      PROGRAM WRT
      CHARACTER*8 FNAME
      WRITE(*, '(1X, A\)') 'OUTPUT FILENAME?:'
      READ(*, '(A)') FNAME
      END

Additional reference words: 3.31 TAR54911

=============================================================================

Copyright Microsoft Corporation 1994.
