Chapter
51
Basic
Concepts
Octal
numbers are the octal representation of decimal numbers.
They contain
1
to
6
digits and are preceded by
&O
or
&.
Al-
though only the
&
is
required, we recommend that you use
&O
for
clarity in your programs. The octal numbers are
0, 1, 2,
3,
4,
5,
6,
and
7.
Here are some octal numbers and their decimal
equivalents:
Octal Decimal
&7
7
&0123
83
&0000456 302
BASIC stores octal numbers as integers.
Constants
Constants are values input to a program that are not subject to
change. Constants can be either string or numeric data (integer,
single or double precision, hexadecimal, or octal).
Numeric data that will not change can be represented as either
a string or numeric constant. If you use punctuation in the num-
ber, it must be a string constant. For example:
PR
I
NT
"$25
0
,0 0 0
"
When BASIC encounters a data constant in a statement, BASIC
must determine how to store it:
If the value
is
enclosed in quotation marks, BASIC stores it
as
a
string.
If the value
is
not enclosed in quotation marks, BASIC
stores it as an integer or a single precision or a double pre-
cision number, according to the requirements described in
the previous section. The section, "Declaring Numeric Con-
stants and Variables," describes ways to override BASIC's
classification of constants.
BASIC evaluates numeric constants in program lines as soon as
you enter the line. It does not wait until you run the program. If
any numbers are out of range for their type, BASIC returns an
error message immediately.
Here are some examples of constants:
PR
I
NT
-NAME*',
"ADDRE
s si'
,
"c
I
TY
91
,
"STATE"
46