DOCUMENT:Q149138 03-NOV-1999 [fortran] TITLE :BUG: F6804 or F6511 Error with Spaces in Namelist Input File PRODUCT :Microsoft Fortran Compiler PROD/VER::4.0 OPER/SYS: KEYWORDS:kbFortranPS kbLangFortrankbbuglist ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Fortran PowerStation for Windows 95 and Windows NT, version 4.0 ------------------------------------------------------------------------------- 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 : kbFortranPS kbLangFortran kbbuglist Technology : kbAudDeveloper kbPTProdChange kbFortranSearch kbFORTRANPower400NT Version : :4.0 ============================================================================= 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. Copyright Microsoft Corporation 1999.