FIX: F2725 Error, Array of Structures Element in READ Iolist

ID: Q51284


The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, version 5.0
  • Microsoft FORTRAN for OS/2, version 5.0


SYMPTOMS

An attempt to compile an application fails and the compiler generates the following message:

error F2725 illegal input list item


CAUSE

The application includes a READ statement where the iolist contains elements of an array of records.


RESOLUTION

To address this error, perform one of the following two procedures:

  • Modify the source code to use one structure instead of an array of structures.


  • -or-

  • Modify the source code to specify a temporary variable in the READ statement iolist and assign the desired array element to the temporary variable.



STATUS

Microsoft has confirmed this to be a problem in FORTRAN version 5.0 for MS-DOS and OS/2. This problem was corrected in FORTRAN version 5.1 for MS-DOS and OS/2.


MORE INFORMATION

According to page 218 of the Microsoft FORTRAN "Reference" manual for versions 5.0 and 5.1, an application can declare an array of structures. According to page 214, the iolist can contain structure elements.

The following code example demonstrates this problem.

Sample Code #1


C Compile options needed: None

    C Compile options needed: None

      STRUCTURE /SPECLIMIT/ 
      REAL*4 A
      END STRUCTURE

      RECORD /SPECLIMIT /LIMIT(5)
      N = 1
      LIMIT(N).A = 34.56
      READ (*, 1000) LIMIT(N).A    ! array causes error
1000  FORMAT (F6.2)
      END 
The following code example demonstrates one method to address this problem.

Sample Code #2


C Compile options needed: None

      STRUCTURE /SPECLIMIT/ 
      REAL*4 A
      END STRUCTURE
      REAL*4 TMP

      RECORD /SPECLIMIT /LIMIT(5)
      N = 1
      LIMIT(N).A = 34.56
      READ (*, 1000) TMP
      LIMIT(N).A = TMP
1000  FORMAT (F6.2)
      END 

Additional query words: 5.00 buglist5.00 fixlist5.10

Keywords :
Version : :5.0
Platform :
Issue type :


Last Reviewed: November 3, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.