Numeric data
dBL supports a single numeric data type. It does not distinguish between integers and non-integers, which are also referred to as floating-point numbers. Table formats vary in the types of numbers they store. Some support short (16-bit) and long (32-bit) integers or currency in addition to a numeric format. When these numbers are read into dBASE Plus, they are all treated as plain numbers. When numbers are stored into tables, they are automatically truncated to fit the table format.
In dBL, a numeric literal may contain a fractional portion, or be multiplied by a power of 10. The following are all valid numeric literals:
42
5e7
.315
19e+4
4.6
8.306E–2
As the examples show, the "E" to designate a power of 10 may be uppercase or lowercase, and you may include a plus sign to indicate a positive power of 10 even though it is unnecessary.
In addition to decimal literals, you may use octal (base 8) or hexadecimal (base 16) literal integers. If an integer starts with a zero (0), it is assumed to be octal, with digits from 0 to 7. If it starts with 0x or 0X, it is hexadecimal, with the digits from 0 to 9 and the letters A to F, uppercase or lowercase. For example,
Literal |
Base |
Decimal value |
031 |
Octal |
25 |
0x64 |
Hexadecimal |
100 |