BUG: Write of Function Returning a Character String FailsLast reviewed: April 26, 1996Article ID: Q150125 |
The information in this article applies to:
SYMPTOMSWhen you declare a function that returns a variable size array of variable length character strings by putting the array declaration part before the string declaration part, a write of the array-valued function fails to produce correct results.
RESOLUTIONReorder the declaration by specifying the string declaration part before the array declaration part.
STATUSMicrosoft has confirmed this to be a bug 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.
MORE INFORMATIONThe following sample code causes the write of the array to print nothing. Changing the declaration, so the string is declared before the array, causes the correct output 1 to be written to the display.
Sample Code to Illustrate Problem! Compile options needed: none
program test interface function h(i,j)! comment the following two lines for workaround dimension h(i) character(len=j) h! uncomment the following two lines for workaround ! character(len=j) h ! dimension h(i) end function end interface write(*,*) h(1,1) end program test function h(i,j)! comment the following two lines for workaround dimension h(i) character(len=j) h! uncomment the following two lines for workaround ! character(len=j) h ! dimension h(i) h = '1234567890' end function |
Additional reference words: 4.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |