FIX: Protection Violation When Structure Element Used in OPENLast reviewed: September 11, 1997Article ID: Q67615 |
5.00
OS/2
kbtool kbfixlist kbbuglist
The information in this article applies to:
SYMPTOMSAn attempt to compile an application fails and the compiler generates a protection violation.
CAUSEThe application uses an element of a structure as the filename in an OPEN statement.
RESOLUTIONTo work around this problem, perform one of the following two steps:
STATUSMicrosoft has confirmed this to be a problem in the FORTRAN version 5.0 for MS-DOS and OS/2. This problem was corrected in FORTRAN version 5.1 for MS-DOS and OS/2.
MORE INFORMATIONThe code example below demonstrates this problem.
Sample Code #1C Compile options needed: None
PROGRAM TEST STRUCTURE /IO/ CHARACTER*12 NAME END STRUCTURE RECORD /IO/ IOINST IOINST.NAME = 'TEST.DAT' OPEN (10, FILE = IOINST.NAME) ENDThe code example below alleviates this problem by using the temporary variable TMP to hold the filename.
Sample Code #2C Compile options needed: None
PROGRAM TEST STRUCTURE /IO/ CHARACTER*12 NAME END STRUCTURE CHARACTER*12 TMP RECORD /IO/ IOINST IOINST.NAME = 'TEST.DAT' TMP = IOINST.NAME OPEN (10, FILE = TMP) END |
Additional reference words: 5.00 buglist5.00 fixlist5.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |