Describes integer data types
Integers are whole numbers with no fractional part. In PBL all integer types are signed. Integers are suitable for storing unit quantities and are also used within program code as counters in loops or to handle various system values such as colors, character codes, and so on.
| Type | Example | Digits Allowed |
|---|---|---|
| octal | 0567 | 0, 1, 2, 3, 4, 5, 6, 7 |
| decimal | 579 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 |
| hexadecimal | 0x5AF3 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F |
Octal (base 8) numbers are prefixed by a 0 (zero), and are rarely used. Hexadecimal (base 16) numbers are prefixed by '0x' and may be required for some types of values. However, in most situations with PBL, only decimal (base 10) integers will be used. These should not be confused with the Decimal data type, described below.
n As Int(<precision>)For example, if you wish to declare a 32-bit Int variable, you would use:
n As Int(32)