PRB: Error 62 When Function Call Precedes Function Declaration
PSS ID Number: Q10657
Article last modified on 02-09-1993

3.20

MS-DOS


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

 - Microsoft FORTRAN for MS-DOS, version 3.2
----------------------------------------------------------------------

Summary:

SYMPTOMS
   An attempt to compile an application fails and compiler pass 2
   generates the following message:

      Error 62, line ## -- "SUBROUTINE name expected."

CAUSE
   The application specifies a function in a CALL statement before the
   code declares the function.

STATUS
   Microsoft has confirmed this to be a problem in FORTRAN version 3.2
   for MS-DOS. This problem was corrected in FORTRAN version 3.3 for
   MS-DOS.

More Information:

The following code example demonstrates this problem.

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

C Compile options needed: None

      PROGRAM A
      CALL I
      END

      FUNCTION I
      I = 0

      RETURN
      END

The following code example does not reproduce this problem.

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

C Compile options needed: None

      PROGRAM A
      INTEGER J
      J = I()
      END

      FUNCTION I()
      I = 0
      RETURN
      END

Additional reference words: 3.20

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

Copyright Microsoft Corporation 1993.
