CBFalconer wrote:
Waldek Hebisch wrote:
Adriaan van Os wrote:
GPC accepts:
var i: integer value not 0;
There is a use for this extension; it is not expressible in Pascal.
but it doesn't accept:
var w: word value not 0;
But not for this, as it is expressable as 1 .. maxint;
I think there's a misunderstanding here. `value' (Extended Pascal) means the initial value, not a range restriction. And `not' (in this context, from Borland Pascal) means bitwise not, rather than set complement or whatever you might have thought of.
Apart from that, it should be something like `MaxWord' isntead of `MaxInt' (GPC doesn't actually have `MaxWord', but the more general `High (TypeName)', BTW).
Or did you really mean MaxInt only? If so, this might explain some of our differences WRT unsigned types recently. The point of using unsigned types is usually not to disallow negative values (where a proper integer subrange such as `0 .. MaxInt' would do well), but to have a bigger positive range.
Frank