DISPLAY of INDEX item is not correct.
I set a USAGE INDEX item to X"FFFFFFFF" then did a DISPLAY and a COBDUMP of the item.
DISPLAY shows a value -000000001. COBDUMP correctly shows FFFFFFFF.
INDEX items are not supposed to ever be negative.
I attached a tiny program and the called COBDUMP.
I included the COBDUMP I use because I corrected the problem that the sample program has. In order to properly show hex data with a high order 8 bit, the sample program needs the following change.
05 WS-Buffer-Byte-NUM USAGE BINARY-CHAR UNSIGNED.
Unless I am doing something wrong, this is a little bug with DISPLAY.
I'm on MinGW 3.1.2
Why did I do this? Just because.
Michael
It isn't a bug, the actual storage of an index is a "hardware oriented storage defined by the implementor" and therefore can also be as signed integer if the compiler sees that as to be hardware oriented.
You may
DISPLAYit to get a clue how it is stored, but the actual relation between the storage in memory and the stored value is undefined by the standard.It would be possible to add a dialect option to store index values "not optimal", if this is really needed, but so far I've not seen a case where this is true.