Microsoft KB Archive/106529

From BetaArchive Wiki

Article ID: 106529

Article Last Modified on 12/1/2003


  • Microsoft FORTRAN PowerStation 1.0 Standard Edition
  • Microsoft Fortran PowerStation 1.0a for MS-DOS
  • Microsoft FORTRAN PowerStation 32
  • Microsoft FORTRAN PowerStation 32

This article was previously published under Q106529


The intrinsic function GetStrQQ leaves spurious characters in the standard output buffer that are displayed on the next statement that flushes the buffer.


Use the READ statement instead of GetStrQQ for reading from the standard input device. Alternatively, the GetCharQQ function may be used within a DO loop.


Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Contrary to the documentation, there is no advantage to using GetStrQQ rather than READ for standard I/O.

Run the sample code below, and enter any string when prompted. The output has a blank line under "Enter string: abc" but not under "Enter another string: abc", and in addition there is an extra space in front of the first 1000. GetStrQQ produces the extra linefeed and space characters, whereas the standard READ statement does not.


Enter string: abc

Enter another string: abc

Sample Code

C No compiler options required

        include ''
        include 'flib.fd'
        character string*10

        write(*,'('' Enter string: ''\)')
        len = getstrqq(string)

        do i = 1,2
          write(*,*)  i*1000
        end do

        write(*,'('' Enter another string: ''\)')
        read(*,'(a)')  string

        do i = 1,2
          write(*,*)  i*1000
        end do

Additional query words: 1.00 1.00a 4.00

Keywords: KB106529