FIX: Implied DO-loop with DATA, Structure Causes F1900Last reviewed: September 16, 1997Article ID: Q84327 |
The information in this article applies to:
SYMPTOMSWhen 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 exceededA 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.
RESOLUTIONTo initialize an array of record elements of type CHARACTER, use assignment statements or read the data from an external file.
STATUSMicrosoft 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 INFORMATIONThe 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'/ endThe 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |