FIX: Concatenation of Substring in IF Statement

ID: Q68223


The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, versions 5.0, 5.1
  • Microsoft FORTRAN for OS/2, versions 5.0, 5.1


SYMPTOMS

The code example below causes a Protection Violation when run under OS/2 and bad results when run under MS-DOS. Under MS-DOS, it prints

NO
YES
instead of printing
YES
YES


STATUS

Microsoft has confirmed this to be a bug in the products listed above. This problem was corrected in FORTRAN PowerStation, version 1.0.


MORE INFORMATION

The following sample code can be used to demonstrate the problem.

Sample code


      character*2 r/'AA'/ 
      n=0
c
      if ('BBB'.gt.r(1:n+2)//'A') then
         write (*,*) 'YES'
      else
         write (*,*) 'NO'
      endif
c
      if ('BBB'.gt.r(1:2)//'A') then
         write (*,*) 'YES'
      else
         write (*,*) 'NO'
      endif
      end 

Additional query words: 5.00 5.10 buglist5.00 buglist5.10 fixlist1.00

Keywords :
Version : :5.0,5.1
Platform :
Issue type :


Last Reviewed: November 1, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.