PRB: Internal Error 828, Formal Parameter as Implied-DO Index
PSS ID Number: Q10648
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
----------------------------------------------------------------------

SYMPTOMS
   An attempt to compile an application fails and the first pass of
   the compiler (FOR1.EXE) generates the following message:

      Internal Error 828

CAUSE
   The application modifies a formal parameter in an implied-DO loop.

RESOLUTION
   Modify the source code to use a local variable for the implied-DO
   loop index instead of the formal parameter.

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
-----------

C Compile options needed: None

      SUBROUTINE EXAMPLE(I)
      DIMENSION A(80)

C EXPLICIT DO LOOP WORKS FINE
      DO 10 I = 1,10
   10 CONTINUE

C IMPLICIT DO LOOP WORKS IF VAR IS NOT FORMAL PARAMETER
      READ(*, *) (A(J), J = 1, 79)

C IMPLICIT DO LOOP FAILS WHEN VAR IS FORMAL PARAMETER OF SUBROUTINE
      READ(*, *) (A(I), I = 1, 79)

      RETURN
      END

Additional reference words: 3.20

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

Copyright Microsoft Corporation 1993.
