dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Pascal
Expertise: Beginner
Jan 29, 1999

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


SizeOf Function in Delphi

Question:
I'm using Delphi 2.0 Client/Server. The Delphi Object Pascal user's guide says that the Integer size is 2 bytes (signed 16-bit with Range -32768-32768). But when I do the SizeOf(Integer) in the Delphi Evaluate box, I get the value 4. Is the SizeOf Integer in Delphi 2 or 4 bytes?

Answer:
Hmmm...must have been a holdover from the Delphi 1 documentation. In Delphi 1, Integer types were pure 16-bit, or 2 byte types. In all Win32 versions of Delphi, Integer is a 32-bit or 4-byte type. If you still need to use a 16-bit integer in Delphi 2, just declare you variable as SmallInt.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date