PRB: F2414: Initializing Substrings in DATA Statements (71313)
The information in this article applies to:
- Microsoft FORTRAN Compiler for MS-DOS 4.0
- Microsoft FORTRAN Compiler for MS-DOS 4.01
- Microsoft FORTRAN Compiler for MS-DOS 4.1
- Microsoft FORTRAN Compiler for MS-DOS 5.0
- Microsoft FORTRAN Compiler for MS-DOS 5.1
- Microsoft FORTRAN compiler for OS/2 4.1
- Microsoft FORTRAN compiler for OS/2 5.0
- Microsoft FORTRAN compiler for OS/2 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 Q71313 SYMPTOMS
Using Microsoft FORTRAN to compile a program that attempts to initialize
substrings using an implied-DO list in a DATA statement may result in the
following error messages:
error F2414: (string name) : DATA : not array-element name
warning F4400: DATA : more constants than names
CAUSE
This is not a problem with the compiler. The ANSI 77 Standard
prohibits the use of implied-DO loops in DATA statements for anything
but arrays. Character substrings are not considered arrays.
RESOLUTION
Possible solutions to suppress the F2414 and F4400 error messages are:
- Initializing the list of substring array elements individually
instead of using an implied-DO list in the DATA statement.
- Initializing the whole string variable instead of a substring when
using an implied-DO list in the DATA statement.
- Initializing substring array elements individually with assignment
statements.
| Modification Type: | Major | Last Reviewed: | 12/1/2003 |
|---|
| Keywords: | KB71313 |
|---|
|