EasyManua.ls Logo

Radio Shack TRS-80 Model III - Page 114

Radio Shack TRS-80 Model III
274 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
TRS-80
MODEL III
String
Data
Strings
(sequences of
characters) are useful for storing
non-numeric
information
such as
names,
addresses, text, etc. You
may
store any ASCII
characters
as a
string.
(A
list of
ASCII
characters is in the Appendix).
For example, the data constant:
Jack Brown, Age
38
can
be
stored
as a
string of 18 characters. Each character (and blank) in the string is
stored as an ASCII code, requiring one byte of storage. BASIC
would store the above
string constant internally as:
Hex
4A
61
63 6B
20
42 72 6F
77
6E
2C
20 41 67
65
20
33
38
Code
ASCII
Char-
J
a
c
k
B
r
w
n
J
A
9
e 3
8
acter
A
string can
be up to 255
characters long. Strings with length zero are called
'
'null"
or
"empty".
How BASIC Classifies Constants
When
BASIC
encounters a data constant in
a
statement, it must determine the
type of
the constant: string, integer, single precision, or double precision. First, we will
list
the rules BASIC uses to classify the constant. Then we will show you how
you
can
override these rules, if you want
a
constant stored differently:
Rulel
If the value is enclosed in
double-quotes,
it is
a
string. For example:
"YES"
"3331
Waverly Way"
"1234567890"
the values in
quotes are automatically classified as strings.
Rule
2
If
the value is not in quotes, it is a number. (An exception to this rule is
during data
input by an operator, and in DATA
lists. See INPUT, 1NK.EYS, and DATA)
104

Other manuals for Radio Shack TRS-80 Model III

Related product manuals