FIX: Concatenation of Substring in IF Statement (68223)



The information in this article applies to:

  • Microsoft FORTRAN Compiler for MS-DOS 5.0
  • Microsoft FORTRAN Compiler for MS-DOS 5.1
  • Microsoft FORTRAN compiler for OS/2 5.0
  • Microsoft FORTRAN compiler for OS/2 5.1

This article was previously published under Q68223

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
				

Modification Type:MajorLast Reviewed:12/1/2003
Keywords:kbfix KB68223