Sign in Join
Wiki copytemporary

simple type: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: simple type

OldNewLine
1+A **simple type** is a single value which can be stored in an [[Identifier]]. Simple types are predefined by the compiler, but are not [[Reserved word|reserved words]]. While it is not recommended, they can be redefined.
2+
3+Simple types predefined by the compiler are:
4+
5+| name | bytes | comment |
6+|----|----|----|
7+| boolean | 1 | |
8+| cardinal | 4 | |
9+| char | 1 (unless you use {\$mode DelphiUnicode} or {\$ModeSwitch UnicodeStrings}, then it will be 2) | most likely 1 |
10+| int8 | 1 | by definition |
11+| int16 | 2 | by definition |
12+| int32 | 4 | by definition |
13+| int64 | 8 | by definition |
14+| integer | either 2 or 4, depends on compilation mode | |
15+| shortint | 1 | \<= integer |
16+| smallint | 2 | \<= integer |
17+| longint | 4 | \>= integer |
18+| byte | 1 | by definition |
19+| word | 2 | by definition |
20+| dword | 4 | by definition |
21+| qword | 8 | by definition |
22+| pointer | depends on target cpu bitness: on 32-bit it is 4, on 64-bit it is 8 | |
23+| single | 4 | single precision float |
24+| double | 8 (if the system supports this type, otherwise it's an alias for single) | double precision float |
25+| extended | 10 (if the system supports this type, otherwise it's an alias for double) | extended precision float |
26+| [[real]] | 4 or 8 (platform dependant) | |
27+| currency | 8 | |
28+
29+---
30+*From the Free Pascal wiki, page "simple type", as it stood on 2023-01-30 after a change by Bart, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history