BUG: F2707 on an Internal Read or Write to Record Element (118433)



The information in this article applies to:

  • Microsoft FORTRAN Compiler for MS-DOS 5.1
  • Microsoft FORTRAN PowerStation for MS-DOS 1.0
  • Microsoft FORTRAN PowerStation for MS-DOS 1.0a
  • Microsoft Fortran Powerstation 32 for Windows NT 1.0

This article was previously published under Q118433

SYMPTOMS

A program that uses a character string that is a member of an element in an array of records as an internal file gets the following error when compiling:
error F2707: illegal unit specifier

STATUS

Microsoft has confirmed this to be a bug in FORTRAN for MS-DOS, version 5.1, the FORTRAN PowerStation for MS-DOS, versions 1.0 and 1.0a, and the FORTRAN PowerStation 32 for Windows NT, version 1.0. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Reading or writing to a string used as an internal file generates a compiler error if the string is a member of an element of an array of records.

To demonstrate the problem, compile the sample code below. If "r" were a single record (not an array), or if "r" were an array of character strings (not records), the sample code would compile without error.

Sample Code

c compile options needed: none

      structure /s/ 
        character*6 cvar
      end structure
      record /s/ r(10)
      write (r(1).cvar,'(I6)') 123
      end
				

Modification Type:MajorLast Reviewed:12/1/2003
Keywords:KB118433