Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
BASIC Literal Constants
◄Variables► ◄Data Types► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
BASIC Literal Constants
──────────────────────────────────────────────────────────────────────────────
String Constants
Type Description
──────────────────────────────────────────────────────────────────────────────
String A string constant can contain up to 32,767 characters.
These characters must have actual and extended ASCII
codes between 0 and 255 (excluding the double-quote
character, carriage return and line-feed sequences).
Examples of string constants are:
Hello
25,000.000
Number of Employees
──────────────────────────────────────────────────────────────────────────────
Numeric Constants
Numeric constants are positive or negative numbers and cannot contain commas.
Type (subtype) Description
──────────────────────────────────────────────────────────────────────────────
Integer One or more decimal digits (0-9), with an optional sign
(decimal) prefix (+ or -). The range for integer decimal
constants is -32,768 to 32,767.
Integer One or more hexadecimal digits (0-9, a-f, or
(hexadecimal) A-F) with the prefix &H or &h. The range for integer
hexadecimal constants is &h0 to &hFFFF.
Integer One or more octal digits (0-7) with the prefix &O, &o,
(octal) or &. The range for integer octal constants is &o0 to
&o177777.
Long integer One or more decimal digits (0-9), with an optional sign
(decimal) prefix (+ or -) and the suffix &. The range for long
decimal constants is -2,147,483,648 to 2,147,483,647.
Long integer One or more hexadecimal digits (0-9, a-f, or A-F) with
(hexadecimal) the prefix &H or &h and the suffix &. The range for
long hexadecimal constants is &h0& to &hFFFFFFFF&.
Long integer One or more octal digits (0-7) with the prefix &O, &o,
(octal) or & and the suffix &. The range for long octal
constants is &o0& to &o37777777777&.
Fixed point Positive or negative real numbers (numbers containing
decimal points).
Currency Positive or negative real numbers (numbers containing
decimal points) with the suffix @, having 19 digits of
precision, with a maximum of 4 digits to the right of
the decimal point. The range for currency constants
is -922337203685477.5808 to 922337203685477.5807.
Floating point Positive or negative numbers represented in exponential
(single precision) form. A single-precision floating-point constant is an
optionally signed integer or fixed-point number (the
mantissa) followed by the letter E and an optionally
signed integer (the exponent). The constant's value is
the mantissa multiplied by the power of ten represented
by the exponent. Single-precision constants have a
range of -3.40E38 to 3.40E38.
Floating point Double-precision floating-point constants have the same
(double precision) form as single-precision floating-point constants, but
use D, rather than E, to indicate the exponent. Double-
precision constants have a range of -1.79D308 to
1.79D308.
──────────────────────────────────────────────────────────────────────────────
See Also ◄Constants - Definition►
◄Numeric Constants - Definition►
◄Scope Rules►
◄Symbolic Constants►
◄Type Conversion►
◄ASCII Character Code Set►