FIX: F1001: ctypes.c, Line 467; LEN_TRIM on PARAMETER String

Last reviewed: September 11, 1997
Article ID: Q74219
5.00 5.10 | 5.00 5.10
MS-DOS    | OS/2
kbtool kbfixlist kbbuglist kberrmsg

The information in this article applies to:

  • Microsoft FORTRAN for MS-DOS, versions 5.0 and 5.1
  • Microsoft FORTRAN for OS/2, versions 5.0 and 5.1

SYMPTOMS

Using Microsoft FORTRAN versions 5.0 or 5.1 to compile a program that uses the LEN_TRIM intrinsic function on a character string that is defined as a PARAMETER may result in the following error:

   fatal error F1001: Internal Compiler Error
       (compiler file '@(#)ctypes.c:1.12', line 467)

STATUS

Microsoft has confirmed this to be a problem in FORTRAN versions 5.0 and 5.1 for MS-DOS and OS/2. This problem was corrected in FORTRAN PowerStation.

MORE INFORMATION

The following program will generate the internal compiler error:

      character*8 a
      parameter (a='abcdef  ')
      print*,len_trim(a)
      end

Since the length of a PARAMETER character is fixed, and therefore, the last nonblank character is known when the program is compiled, use of the LEN_TRIM function on PARAMETER character strings can be avoided by using this known constant value, or by using another PARAMETER to store this value.

It is also possible to pass the PARAMETER as an argument to a function and to call the LEN_TRIM intrinsic function from within this user defined function without generating any errors. The following program illustrates this solution:

      character*8 a
      parameter (a='abcdef  ')
      integer*4 trim
      print*, trim(a)
      end

      integer*4 function trim(a) ! User-defined substitute
                                 ! for LEN_TRIM
      character*(*) a
      trim = len_trim(a)
      end


Additional reference words: 5.00 5.10
KBCategory: kbtool kbfixlist kbbuglist kberrmsg
KBSubcategory: FLIss
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.