FIX: Implied DO-loop with DATA, Structure Causes F1900

Last reviewed: September 16, 1997
Article ID: Q84327

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

SYMPTOMS

When attempting to initialize an array of structure elements with a DATA statement that uses an implied DO-loop, the Microsoft FORTRAN 5.1 compiler may generate the following error under MS-DOS:

   fatal error F1900: maximum memory-allocation size exceeded

A trap C with the following error message may be generated under OS/2:

   SYS1942: A program attempted to reference storage outside the
   limits of a stack segment. The program was ended.

These messages occur only when the data being initialized in the implied DO- loop of the DATA statement is of type CHARACTER.

RESOLUTION

To initialize an array of record elements of type CHARACTER, use assignment statements or read the data from an external file.

STATUS

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

MORE INFORMATION

The following code produces the F1900 error when compiled under MS-DOS, and the SYS1942 error when compiled under OS/2:

Sample Code 1

      structure /s/
         character*2 ch
      end structure
      record /s/ a(20)
      data (a(j).ch,j=1,3) /'h ','he','hj'/
      end

The example below shows how assignment statements may be used to initialize the array of CHARACTER record elements:

Sample Code 2

      structure /s/
         character*2 ch
      end structure
      record /s/ a(20)
      logical flag /.true./
c
      if (flag) then
         flag=.false.
         a(1).ch='h '   ! assignment statements
         a(2).ch='he'
         a(3).ch='hj'
      endif
      end


Additional query words: 5.10 buglist5.10 fixlist1.00
Keywords : kberrmsg kbtool kbbug
Version : 5.1 | 5.1
Platform : MS-DOS OS/2
Solution Type : kbfix


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: September 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.