FIX: Z Format Hangs Machine with String > 130 Bytes (84576)



The information in this article applies to:

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

This article was previously published under Q84576

SYMPTOMS

Programs that contain a string or substring larger than 130 bytes in size that is output with a Z edit descriptor may hang the machine or cause a protection violation under OS/2 or Windows.

RESOLUTION

To use the Z edit descriptor with strings larger than 130 bytes in size, use an implied DO-loop to output a single byte of the larger string at a time.

STATUS

Microsoft has confirmed this to be a problem in FORTRAN version 5.1. This problem was corrected in FORTRAN PowerStation, version 1.0.

MORE INFORMATION

Sample Code #1

The following code reproduces the problem:
      character*131 c

      c = 'this is a test'
      write(*, '(1x,z)') c
      end
				

Sample Code #2

The following code will not cause the problem:
      character*131 c

      c = 'this is a test'
      write( *,'(1x,200z)') ( c(i:i),i=1,131 )
      end
				

Modification Type:MajorLast Reviewed:10/23/2003
Keywords:kbfix KB84576