EasyManua.ls Logo

Radio Shack TRS-80 Model III - Arrays

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...
BASIC
19 /
Strings
'
'Without string-handling
capabilities,
a
computer isjust a
super-powered
calculator.
'
'
There's an
element
of
truth
in that
exaggeration; the more you
use the
string capabilities
of
Model III BASIC ,
the truer the
statement will seem
.
In
Model III BASIC any valid
variable name can
be used
to contain string
values,
by
the DEFSTR
statement or by
adding a type
declaration
character to
the name. And
each
string can contain up to
255
characters.
Moreover, you can
compare
strings to
alphabetize them,
for
example
.
You
can take
strings apart and
string them together
(concatenate them)
.
For
background
material to
this chapter,
see
Chapter
15
,
"Variable
Types'
'
;
Chapter
18,
DEFSTR;
and
Appendix H,
'
'Glossary' '
.
Functions covered
in this chapter:
FRE(
string) LEFTS
STRIN'
INKEY$
MID$
TIMES
LEN
ASC
RIGHTS
STR$
VAL
CHR$
NOTE
.-Whenever
string is given as afunction
argument, you
can use a
string
expression
or constant.
String Space
Fifty bytes of
memory are set
aside
automatically to store
strings. If you
run
out
of
string space, you
will get an OS
error and you
should use the CLEAR
n command to
save
more space.
Note:
CLEAR
also sets
variables to zero
or null
strings.
To
calculate the space
you
'11
need ,
multiply the
amount of space each variable takes
(See VARPTR)
by the
number of
string variables you are
using
.
including temporary
variables.
Temporary
variables
are created
during the
calculation of
string functions.
Therefore
even if you have
only
a
few short
string
variables assigned in
your
program, you may
run out
of string space
if you
concatenate them
several times.
163

Other manuals for Radio Shack TRS-80 Model III

Related product manuals