ID Number: Q77483
3.12
OS/2
buglist3.12
Summary:
PROBLEM ID: CV9110002
SYMPTOMS
When running protected-mode CodeView version 3.12 on a program
compiled with Microsoft FORTRAN version 5.1, the values of an
expanded array indexed with negative subscripts may not be
displayed. Instead, when attempting to expand the array in the
Local window, Watch, or Quick Watch window, question marks or
incorrect results may be displayed in place of the value of the
array element.
If the array being indexed with negative subscripts is of type
CHARACTER, any negative subscripted element of the array may be
displayed as blanks, whether the element is part of an array being
expanded or is being examined individually.
These problems are not present with CodeView version 3.14 and
Microsoft FORTRAN 5.1 under MS-DOS.
RESOLUTION
To view the contents of array elements other than CHARACTER arrays
that are indexed by negative subscripts, set an explicit watch for
the desired array element.
To set an explicit watch, choose Add Watch from the Watch menu, or
use the following instruction in the Command Line window:
001> W? RealArray(-1)
Use the following to set a Quick Watch:
001> ?? RealArray(-1)
RealArray is the name of the array to be watched during program
execution, and -1 is an example subscript.
CHARACTER arrays indexed with negative subscripts cannot be
displayed in CodeView for OS/2.
STATUS
Microsoft has confirmed this to be a problem in Microsoft CodeView
version 3.12 for OS/2. We are researching this problem and will
post more information here as it becomes available.
More Information:
Sample Code
-----------
C Compile options needed: none
CHARACTER*7 CharArray(-2:2)
CHARACTER*10 CharArray2 (0:10)
REAL*4 RealArray(-5:5)
C Structure definition, note that the element i has 9 indices
C going from -4 to 4, including 0.
STRUCTURE /Test/
INTEGER i(-4:4)
END STRUCTURE
RECORD /Test/ RecVar
C Initialization of ALL the subscripts in the arrays.
! What CodeView displays:
CharArray = 'FORTRAN' ! Elements -1 and -2 are blank.
CharArray2 = 'Microsoft' ! This array is viewable.
RealArray = 3.14159267 ! Elements -5 through -1
! contain incorrect values.
RecVar.i = 12 ! Elements -4 through -1
! contain zeros.
C Printing out the variables shows that they do contain the expected
C values.
PRINT *, RecVar.i
PRINT *, CharArray2
PRINT *, CharArray
PRINT *, RealArray
END
Additional reference words: h_fortran 5.10