[fpc-pascal] Int64 is not an ordinal...

Bart bartjunk64 at gmail.com
Sat Jan 5 17:51:23 CET 2013


Hi,

I tried using an Int64 as a loop variable in a for loop.
The compiler complained that it was not an ordinal type.

This struck me as odd.
The docs indeed say Int64 and Word are not true ordinal types, but
they seem to fit the definition given in the same document:

1. Ordinal types are countable and ordered, i.e. it is, in principle,
possible to start counting them one by one, in a specified order. This
property allows the operation of functions as Inc, Ord,Dec on ordinal
types to be defined.
2. Ordinal values have a smallest possible value. Trying to apply the
Pred function on the
smallest possible value will generate a range check error if range
checking is enabled.
3. Ordinal values have a largest possible value. Trying to apply the
Succ function on the largest possible value will generate a range
check error if range checking is enabled.

So, why aren't Int64 and QWord "true" ordinals?

Bart



More information about the fpc-pascal mailing list