The information in this article applies to:
SYMPTOMSMixed-language programs with Microsoft FORTRAN 5.0 or 5.1 and Microsoft Basic 7.1, in which the FORTRAN code opens a file or accesses the near heap, can stop the machine upon execution. This problem occurs while running the program under both MS-DOS and OS/2. CAUSEBasic calls its heap initialization sequence twice and FORTRAN calls its initialization sequence once. The second time Basic calls its initialization sequence, it overwrites the information that FORTRAN requires to do file I/O. RESOLUTIONThe Basic program must explicitly call the FORTRAN initialization routine before calling any other FORTRAN routine that does file I/O. It should be called only once, typically at the start of the Basic main program. This routine will rewrite the required FORTRAN file structure information and allow FORTRAN file I/O to function correctly. STATUSMicrosoft has confirmed this to be a problem in Microsoft FORTRAN version 5.0 and 5.1 for MS-DOS and OS/2. We are researching this problem and will post new information here as it becomes available. MORE INFORMATIONThe FORTRAN initialization routine that needs to be called is named __FFinit. The easiest way to call this routine is to use a DECLARE statement in Basic that uses the ALIAS keyword. The following sample code illustrates this solution and runs as expected. If the Basic call to __FFinit is commented out, the program will stop the machine under MS-DOS and stop the current process under OS/2. Basic Sample Code
FORTRAN Sample Code
Note: The following MAKE files are only for use with FORTRAN 5.1. To
use FORTRAN 5.O, you must specify a C-compatible FORTRAN library and
also a C 6.0 run-time library on the link line. For additional
information, please see the following article in the Microsoft Knowledge
Baes:
Q66428 How to Link Basic 7.1 with C 5.1, FORTRAN 5.0, and Pascal 4.0 MAKE File for OS/2
MAKE File for MS-DOS
Additional query words: 5.10 5.00 7.10 F6200
Keywords : kbcode kbFortranPS kbLangFortran |
Last Reviewed: November 1, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |