Frank Heckenbach wrote:
If I understand it right, Integer and Cardinal have different sizes on 16 and 32 bit Delphi, right? This would be like in gpc (though not 16 bit, AFAIK, but 64 bit and perhaps more).
Exactly 16 bits in Delphi1, 32 bits in Delphi2. In any case they are "the best suited signed and unsigned integers for a given machine"
I'd add {Short,Long,LongLong(?),Longest(?)}{Int,Card} here.
But this is much harder to standardize: they will have different meanings on different systems, whence better to reject them in XXcompat units: gpc being cross-platform it will be difficult to give a general rule whereas the others are non ambiguous:
int8 card8 (=byte is the only case without doubt) int16 card16 int32 card32
I agree! Except for "integer", all types can be redeclared in these units. (I think, "integer" could be redeclared, too, but AFAIR it's not a good idea to do so, is it?)
certainly a bad idea in general, but notice that in BP I frequenly used a defreal unit, (referenced from the main and all other units) which contains either
type real = single or type real = double or type real = extended
to have a quick way to see the effect of the size of reals on accuracy or speed of some computations. But this is a purely private trick which should be restricted to such peculiar purposes.