ReNamer:Pascal Script:Types: Difference between revisions
Jump to navigation
Jump to search
(Created page with '{{Template:Expand}} {| align="right" | __TOC__ |} == Integer types == {| class="wikitable" ! Type ! Size ! Range |- | Byte | 1 byte | align="center" | 0 .. 255 |- | ShortInt | ...') |
No edit summary |
||
Line 11: | Line 11: | ||
! Range | ! Range | ||
|- | |- | ||
| Byte | | '''Byte''' | ||
| 1 byte | | 1 byte | ||
| align="center" | 0 .. 255 | | align="center" | 0 .. 255 | ||
|- | |- | ||
| ShortInt | | '''ShortInt''' | ||
| 1 byte | | 1 byte | ||
| align="center" | -128 .. 127 | | align="center" | -128 .. 127 | ||
|- | |- | ||
| Word | | '''Word''' | ||
| 2 bytes | | 2 bytes | ||
| align="center" | 0 .. 65535 | | align="center" | 0 .. 65535 | ||
|- | |- | ||
| SmallInt | | '''SmallInt''' | ||
| 2 bytes | | 2 bytes | ||
| align="center" | -32768 .. 32767 | | align="center" | -32768 .. 32767 | ||
|- | |- | ||
| Cardinal | | '''Cardinal''' | ||
| 4 bytes | | 4 bytes | ||
| align="center" | 0 .. 4294967295 | | align="center" | 0 .. 4294967295 | ||
|- | |- | ||
| Integer | | '''Integer''' | ||
| 4 bytes | | 4 bytes | ||
| align="center" | -2147483648 .. 2147483647 | | align="center" | -2147483648 .. 2147483647 | ||
Line 42: | Line 42: | ||
! Range | ! Range | ||
|- | |- | ||
| Single | | '''Single''' | ||
| | | 4 bytes | ||
| 1. | | align="center" | 1.5 x 10<sup>-45</sup> .. 3.4 x 10<sup>38</sup> | ||
|- | |- | ||
| Double | | '''Double''' | ||
| | | 8 bytes | ||
| | | align="center" | 5.0 x 10<sup>-324</sup> .. 1.7 x 10<sup>308</sup> | ||
|- | |- | ||
| Extended | | '''Extended''' | ||
| | | 10 bytes | ||
| 3. | | align="center" | 3.6 x 10<sup>-4951</sup> .. 1.1 x 10<sup>4932</sup> | ||
|} | |} | ||
Line 60: | Line 60: | ||
! Description | ! Description | ||
|- | |- | ||
| Char | | '''Char''' | ||
| Stores a single Ansi character | | Stores a single Ansi character | ||
|- | |- | ||
| String | | '''String''' | ||
| Holds a sequence of Ansi characters of any length | | Holds a sequence of Ansi characters of any length | ||
|- | |- | ||
| WideString | | '''WideString''' | ||
| Holds a sequence of Unicode characters of any length | | Holds a sequence of Unicode characters of any length | ||
|} | |} | ||
Line 76: | Line 76: | ||
! Description | ! Description | ||
|- | |- | ||
| Boolean | | '''Boolean''' | ||
| | | Provides an enumeration of the logical '''True''' and '''False''' values | ||
|- | |- | ||
| Array | | '''Array''' | ||
| | | Single and multi dimensional indexable sequences of data | ||
|- | |- | ||
| Record | | '''Record''' | ||
| | | Provides means of collecting together a set of different data types into one named structure | ||
|- | |- | ||
| | | '''Variant''' | ||
| Provides a flexible general purpose data type | |||
| | |||
|} | |} | ||
== Enumerations == | |||
An enumeration is simply a fixed range of named values. | |||
For example, the Boolean data type is itself an enumeration, with two possible values: True and False. If you try to assign a different value to a Boolean variable, the code will not compile. |
Revision as of 16:55, 16 June 2009
Integer types
Type | Size | Range |
---|---|---|
Byte | 1 byte | 0 .. 255 |
ShortInt | 1 byte | -128 .. 127 |
Word | 2 bytes | 0 .. 65535 |
SmallInt | 2 bytes | -32768 .. 32767 |
Cardinal | 4 bytes | 0 .. 4294967295 |
Integer | 4 bytes | -2147483648 .. 2147483647 |
Floating point types
Type | Size | Range |
---|---|---|
Single | 4 bytes | 1.5 x 10-45 .. 3.4 x 1038 |
Double | 8 bytes | 5.0 x 10-324 .. 1.7 x 10308 |
Extended | 10 bytes | 3.6 x 10-4951 .. 1.1 x 104932 |
String types
Type | Description |
---|---|
Char | Stores a single Ansi character |
String | Holds a sequence of Ansi characters of any length |
WideString | Holds a sequence of Unicode characters of any length |
Other types
Type | Description |
---|---|
Boolean | Provides an enumeration of the logical True and False values |
Array | Single and multi dimensional indexable sequences of data |
Record | Provides means of collecting together a set of different data types into one named structure |
Variant | Provides a flexible general purpose data type |
Enumerations
An enumeration is simply a fixed range of named values.
For example, the Boolean data type is itself an enumeration, with two possible values: True and False. If you try to assign a different value to a Boolean variable, the code will not compile.