EasyManua.ls Logo

Radio Shack TRS-80 Model 4 - Page 160

Radio Shack TRS-80 Model 4
418 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...
8.00100708012 represents the value
8.00100708 x
10
12
Strings
Strings (sequences of characters) are useful for storing non-numeric
information such
as
names, addresses, or text. You may store ASCII
characters,
as
well
as
any of the graphic and non-ASCII symbols,
in
a
string.
(A
list of Character Codes
is
included
in
Appendix
C).
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
Code
ASCII
Char- J
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:
Rule
1
If the value
is
enclosed
in
double-quotes, it
is
a string.
For
example:
"YES"
"3331 Waverly Way"
"1234567890"
are all 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,
INKEY$, and DATA)
2-32

Other manuals for Radio Shack TRS-80 Model 4

Related product manuals