BUG: Inline Comment with "!" Can Act Like a C StringLast reviewed: July 13, 1995Article ID: Q109879 |
The information in this article applies to:
SYMPTOMSA program containing "!" (to denote an inline comment) directly following a string constant interprets the "!" as the letter "C" and appends a null character to the string.
STATUSMicrosoft has confirmed this to be a problem in Microsoft FORTRAN PowerStation 32 version 1.0. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONString values in the C language are terminated with null characters. This type of string is specified in Microsoft FORTRAN by using a standard string constant followed by the character C. The code sample below shows how unwanted null characters are appended to string constants with "!" directly following.
Sample Code
OPEN (1, FILE='TEST') WRITE(1, '(A)') 'Normal string' ! This is a normal FORTRANc string WRITE(1, '(A)') 'Normal C string'C ! The C following the stringc constants indicates a C string WRITE(1, '(A)') 'Extra null char'! ! The "!" treats thisc string as a C string CLOSE (1) END |
Additional reference words: 1.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |