BUG: Problems Passing Arguments to ENTRY StatementLast reviewed: July 6, 1995Article ID: Q73203 |
The information in this article applies to:
SYMPTOMSPrograms compiled with Microsoft FORTRAN versions 4.0, 4.01, 4.1, 5.0, and 5.1 can generate a protection violation when run under OS/2, if a program contains the following:
RESOLUTIONTo avoid this problem, pass the argument to the SUBROUTINE or external FUNCTION as well as to the ENTRY point.
STATUSMicrosoft has confirmed this to be a problem in FORTRAN versions 4.0, 4.01, 4.1, 5.0, and 5.1 for OS/2. We are researching this problem and will post new information here as it becomes available.
MORE INFORMATIONThe following example illustrates the problem:
i=0 call sub end subroutine sub entry entersub(i) i=0 i=i+1 write(*,*) i endThe program above should produce the following output:
1Instead, a protection violation is generated when the program is run under OS/2. Passing the argument to the SUBROUTINE or external FUNCTION in addition to the ENTRY point will prevent the problem from occurring. The following program example illustrates the solution:
i=0 call sub(i) endc ** Argument passed to subroutine **
subroutine sub(i) entry entersub(i) i=0 i=i+1 write(*,*) i end |
Additional reference words: 4.00 4.01 4.10 5.00 5.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |