On 09/10/2019 12:09, Martin wrote:
program test;
type
TTinyNegRange = -2..3;
TBitPackTinyNegArray = bitpacked array [0..3] of TTinyNegRange;
TTestArray = bitpacked array [0..3] of byte;
const
// No Error / WRONG Value, prints: 2, -2, -1, -1 // 0 is replaced
by -1
To initialize an array, negative values can not be specified (see error
below).
Type casting to positive works, if you have the exact bit-size-matching
unsigned type.
If the typecast is to big, it also gives a range check.
But with $R- values that are to big, are truncated.
Except in