[fpc-pascal] History of the Cardinal data type?

Sven Barth pascaldragon at googlemail.com
Tue Mar 29 21:19:45 CEST 2016


Am 29.03.2016 17:27 schrieb "Graeme Geldenhuys" <
mailinglists at geldenhuys.co.uk>:
>
> On 2016-03-29 16:13, Marco van de Voort wrote:
> > Cardinal is the Wirthian designation for the default unsigned integer,
> > just like "integer" is for signed.
>
> Thanks Marco, that fulfils my curiosity. :)
>
>
> On a side note:
>   The reason I asked this question. I'm working on code with many Record
> types with fields of type Word, Smallint etc, than then some Cardinal
> fields got mixed in too. I would normally use LongWord instead of
> Cardinal to keep to a consistent naming convention. But from your
> comments Cardinal has a long history in Pascal.

I usually use LongWord, too, but with the recent discovery that in Delphi
LongWord is not always 32-bit (and my tendency to confuse Short and
SmallInt) I'm inclined to use the (U)IntX (with X being a element of [8,
16, 32, 64]) types to avoid any confusion and surprises.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160329/86f6021b/attachment.html>


More information about the fpc-pascal mailing list