PRB: Errors 59, 152, 162, Parenthesis First Output List Char
PSS ID Number: Q10817
Article last modified on 02-09-1993

3.10 3.13 3.20 3.30 3.31

MS-DOS


----------------------------------------------------------------------
The information in this article applies to:

 - Microsoft FORTRAN for MS-DOS, versions 3.1, 3.13, 3.2, 3.3, 3.31
----------------------------------------------------------------------

SYMPTOMS
   An attempt to compile an application fails and the compiler
   generates the following messages:

      Error 59, line # -- "=" expected
      Error 162, line # -- unrecognizable I/O list element
      Error 59, line # -- "=" expected
      Error 152, line # -- end of statement encountered in implied DO

CAUSE
   The application places a parenthesis "(" at the beginning of an
   output list.

RESOLUTION
   To work around this problem, rearrange the expression in the output
   list such that parenthesis does not appear as the first element of
   the expression.

STATUS
   Microsoft has confirmed this to be a problem in FORTRAN versions
   3.1, 3.13, 3.2, 3.3, and 3.31 for MS-DOS. This problem was
   corrected in FORTRAN version 4.0 for MS-DOS.

More Information:

The following code example demonstrates this problem.

Code Sample #1
--------------

C Compile options needed: None

      WRITE (*, *) (1 + 2) * 3
      END

The compiler generates the errors above for this code because the
compiler treats the expression (1 + 2) as an implied do list. A
parenthesis at the beginning of an output list is valid only in an
implied-DO loop. To work around this problem, change the order of the
expression in the output list as the following code example
demonstrates.

Code Sample #2
--------------

C Compile options needed: None

      WRITE(*, *) 3 * (1 + 2)
      END

Additional reference words: 3.10 3.13 3.20 3.30 3.31 buglist3.10

=============================================================================

Copyright Microsoft Corporation 1993.
