This code works (as could expected):
Code: Select all
const BtMask: array[0..15] of word = (1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768);
....
JWrd := BtMask[7];
When however "BtMask" is declared in another unit, "JWrd" gets filled with "512" in stead of "128".
The problem does not occur with byte arrays declared in a "unit".
Another finding:
Code: Select all
I := 7;
JWrd := BtMask[I];
Any idea? Thanks in advance.
I did place a post with the support desk also.
p.s. I think this type of issue is there already for a while now, see http://www.mikroe.com/forum/viewtopic.p ... const+unit
Reply from the mE support desk:
Successfully reproduced this problem, and informed our software developers about this issue. They will fix this in coming releases of mikroPascal compiler.