PRB: LEN Function Always Returns 538976288 in FORTRAN 3.2, 3.3
PSS ID Number: Q10667
Article last modified on 02-09-1993

3.20 3.30

MS-DOS


----------------------------------------------------------------------
The information in this article applies to:

 - Microsoft FORTRAN for MS-DOS, versions 3.2, 3.3
----------------------------------------------------------------------

Summary:

SYMPTOMS
   An attempt to compile and link an application that uses the LEN
   intrinsic function succeeds even though the LEN function is not
   supported by that version of the compiler. As a result, the LEN
   function always returns the value 538976288.

CAUSE
   The compiler implements the LEN intrinsic function in a peculiar
   manner; the parser recognizes LEN as an intrinsic, but the code
   generator does not create correct code for it.

STATUS
   Microsoft has confirmed this to be a problem in FORTRAN versions
   3.2 and 3.3 for MS-DOS. This problem was corrected in FORTRAN
   version 4.0 for MS-DOS.

More Information:

The following code example demonstrates this problem.

Sample Code
-----------

C Compiler options needed: None

      CHARACTER*20
      ALPHALINE = 'THIS IS A TEST'
      I = LEN(ALPHALINE)

C The following line will print 538976288
       WRITE (*,10) I
10     FORMAT (1X, I16)
       END

Additional reference words: 3.20 3.30

=============================================================================

Copyright Microsoft Corporation 1993.
