Basic
Data
Data, in the form of numbers, characters, or symbols,
is
informa-
tion on which BASIC performs its operations. Data can be of 2 forms,
string and numeric. As well, both string and numeric data can be
of 2 types, variable and constant.
String Data
String data is a sequence of ASCII characters, graphics or non-ASCII
symbols. The maximum length for a string is 255 characters.
Strings can contain either alpha or numeric characters. For exam-
ple: “DOCUMENT 23”, “LEVEL
13”.
The dollar sign
($)
is used to indicate a variable string name. For
example:
NAME$
=
“JOE”
When used in a program, strings are enclosed in quotation marks.
When used in response to a prompt, strings do not require quota-
tion marks.
Numeric
Data
Numeric data consists of positive and negative numbers, which
BASIC divides into 5 groups:
Integers
are whole numbers (without decimal points) in the
range -32768 to +32767.
Single precision numbers
can be a maximum of 7 digits in the
range to 10.38. For example 10001, -200034, 123.456. If
single precision numbers are more than 7 digits, they are
displayed in the exponential form using the E form. For exam-
ple: 1.75635, .98E8, 1043-7.
Double precision numbers
can be
a
maximum
of
16
digits and
have a decimal point. They have the same range as single preci-
sion numbers. If they are more than 16 digits they are displayed
in exponential format, using the D form. For example:
Hexadecimal
numbers represent a numeric system to the base
of 16 instead of 10. They can be
1
to 4 digits and are preceded
by &H. The hexadecimal numbers are 0,
1,
2,
3,
4,
5,
6, 7,
8,
9, A, B, C, D, E,
F.
For example: &H04, &HEE, &H4F, &H22.
8.00100708D12, -6.7765499824D16.
Tandy
1000
9