Microsoft KB Archive/84164

= FIX: Nested $IF Statements With $ELSE Fail =

Article ID: 84164

Article Last Modified on 12/1/2003

-

APPLIES TO


 * Microsoft FORTRAN Compiler 5.1
 * Microsoft FORTRAN Compiler 5.1
 * Microsoft FORTRAN PowerStation 1.0 Standard Edition
 * Microsoft Fortran PowerStation 1.0a for MS-DOS
 * Microsoft FORTRAN PowerStation 32

-



This article was previously published under Q84164



SYMPTOMS
Compiling code that contains nested $IF compiler conditions with $ELSE clauses fails to produce the expected result. The compiler issues error:

error F2830: END missing

This error is generated because all of the source code following the $ELSE condition fails to be compiled.



CAUSE
When there is a $ELSE following a $ENDIF and the outer $IF condition is met making the $ELSE condition false the compiler fails to parse for any metacommands following the $ELSE including the $ENDIF that terminates the outer $IF block.



RESOLUTION
Do not use nested $IF metacommands with $ELSE clauses.



STATUS
Microsoft has confirmed this to be a problem in the products listed above. This problem was corrected in Microsoft FORTRAN PowerStation 32, version 4.0.



MORE INFORMATION
The following code reproduces the problem:

Sample code
$define first subroutine test $if defined (first) $if defined (second) $endif $else $endif return end

Additional query words: 5.10 1.00 1.00a

Keywords: kberrmsg kbfix kblangfortran KB84164

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.