Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Integer Types

0 views
Skip to first unread message

softstuf, inc

unread,
May 26, 1999, 3:00:00 AM5/26/99
to
Could someone please tell me the byte size of an integer in Delphi 3.0. I
am converting 22,000 lines of code from Borland Pascal 7.0 and need to know
if I have to change all my integers to shortint. The help gives me two
sizes for an integer, 2 bytes and four bytes.

If someone can help, could you please e-mail me at ma...@softstuf.com.

Thanks,
Maria

Stefan Hoffmeister (TeamB)

unread,
May 26, 1999, 3:00:00 AM5/26/99
to
: "softstuf, inc" <soft...@softstuf.com> wrote:

>Could someone please tell me the byte size of an integer in Delphi 3.0.

Try

SizeOf(Integer)

and come up with "4".

>The help gives me two sizes for an integer, 2 bytes and four bytes.

Where?

--
Stefan Hoffmeister (TeamB) http://www.econos.de/
Please do apply judgement when sending email.

@fcc.gov Steve Davis

unread,
May 27, 1999, 3:00:00 AM5/27/99
to
For all practical purposes, if you are running W95/98/NT on a Pentium level
computer then ALL of your integer variable types will be 4 bytes (32 bits)
except for INT64 which is 8 bytes (64 bits). This includes SHORT (once upon
a time was 1 byte), INTEGER (on occasion, was either 1 or 2 bytes, but is
now 4), LONGINTEGER (used to be 4 bytes and still is), CARDINAL (this is a
new Delphi type, but is still 4 bytes I'm pretty sure). In 32 bit machines,
they pretty much all default to 32 bits (it's compiler dependent) as the
code runs faster that way (usually). The only exception might be in places
where you might use a PACKED structure where it would be packed into the
smallest space possible.

This stuff meant more when we were operating on 8 bit machines and having to
do special coding to handle 16 bit information and REALLY special coding to
handle larger stuff!

Hope this helps. It may not be entirely correct (since it IS compiler
dependent), but it should give you a better feel for size.

Steve

--
Fix my email address to reply directly.
Stefan Hoffmeister (TeamB) wrote in message
<377659c6...@forums.inprise.com>...

0 new messages