Wednesday, September 24, 2008

Delphi 2009 - New Integer Alias Types

Here are some new useful alias types in Delphi 2009:

type
  Int8   = ShortInt;
  Int16  = SmallInt;
  Int32  = Integer;
  UInt8  = Byte;
  UInt16 = Word;
  UInt32 = Cardinal;

8 comments:

Anonymous said...

Hallelujah! I've never successfully remembered the difference between ShortInt and SmallInt for more than a day. Now I don't have to :-)

Anonymous said...

Indeed, although I can't way I've ever struggled with Byte, Word or Cardinal in the same way and I think I prefer those to UIntN.

:)

stanleyxu (2nd) said...

Good to know. This might be a preparation for Int64

Anonymous said...

What about UInt64?

Anonymous said...

> Good to know. This might be a preparation for Int64

There already is an Int64 :), have been there since Delphi 6 or 7 (or maybe earlier)

Anonymous said...

Isn't there also a "NativeInt = Integer" alias.

Anonymous said...

Yeah, there is a UInt64, Int64, NativeInt and NativeUInt, but they don't appear to be aliases (at least not that are visible in System.pas)

Unknown said...

Great! We could each have done this in our code all using somewhat different naming. Much better that CodeGear set a clear standard.

Post a Comment