Knowledge Base

BUG: F6804 or F6511 Error with Spaces in Namelist Input File

PSS ID Number: 149138

Article Last Modified on 11/3/1999


The information in this article applies to:


This article was previously published under Q149138

SYMPTOMS

Performing a READ of a namelist input file that contains spaces in or between the namelist variable objects causes one of the following run-time errors:
run-time error F6804
- illegal subscript in namelist input record

-or-

run-time error F6511
- variable name not found

RESOLUTION

Remove all spaces in or between namelist object variables from the namelist input file.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

If you use the sample namelist input file "test.in" as a reference, the F6511 error occurs under one of the following conditions:

  • A space precedes a comma separating two or more assignment statements as in this example:
       i = 3  , j = 4
    						
    -or-

  • A space separates an array from its subscript as in this example:
       x (3) = 2
    						
The F6804 error occurs when a space is inside an array subscript as in this example:
   "x( 2) = 1" or "y( 1, 1, 1) = 5"
				

Sample Code to Illustrate Problem

C Compile options needed: none

      integer i, j, x(3), y(1,1,1)
      namelist /thelist/ i, j, x, y
      open(7, file='test.in', mode='read')
      read(7, thelist)
      write(*, thelist)
      end

Namelist input file:

---test.in---
&thelist
i = 3  , j = 4
x (3) = 2
x( 2) = 1
y( 1, 1, 1) = 5
/ 
---end---

				

Additional query words: 4.00

Keywords: kbLangFortran KB149138
Technology: kbAudDeveloper kbFORTRANPower400NT kbFortranSearch kbZNotKeyword8