BUG: Incorrect Output with CARRIAGECONTROL='fortran' Option

Last reviewed: March 28, 1996
Article ID: Q149146
The information in this article applies to:
  • Microsoft Fortran PowerStation for Windows 95 and Windows NT, version 4.0

SYMPTOMS

When you perform a formattted write operation to a file explicitly opened with the CARRIAGECONTROL='fortran' option, the leading space passed with the input data is not used as a carriage control.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

In the following sample code, the File1.out file opened with the option CARRIAGECONTROL='fortran' does not use the space created with the "1X" positional edit descriptor in the WRITE statement as a carriage control. Instead, the very first character in the variable "line" is incorrectly interpreted as a carriage control. File2.out does not use the Fortran carriage control option, so both the space and the character string are correctly written to the file with no problems.

Sample Code to Illustrate Problem

C Compile options needed: none

      character*50 line

      line = 'carriage control'

      open(12,file='file1.out', carriagecontrol='fortran')
      open(14,file='file2.out')

      WRITE(12,'(1X,A50)') line  ! 1X not used as carriage control
      WRITE(14,'(1X,A50)') line  ! 1X used as carriage control
      WRITE(*,'(1X,A50)') line

      close(12)
      close(14)

      end

Output - Screen:

carriagecontrol

Output - File1.out:

 arriagecontrol

Output - File2.out:

 carriagecontrol


Additional reference words: 4.00
KBCategory: kbprg kbbuglist
KBSubcategory: FORTLngIss



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 28, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.