Download Print this page

Radio Shack TRS-80 model III Owner's Manual page 112

Mini-disk operation, trsdos disk operating system, disk basic programming language
Hide thumbs Also See for TRS-80 model III:

Advertisement

DISK BASIC
210 LINE INPUT "TYPE
IN
YOUR NAME
"5
A$
220 LINE INPUT
"DO
YOU LIKE YOUR COMPUTER?
"5
B$
230 LINE INPUT "WHY?
"
5
C$
235 PRINT
240 PRINT
A$
:
PRINT
250
IF
B$=
"NO"
THEN 270
2S0 PRINT
"I
LIKE
MY
COMPUTER BECAUSE
"5
C$
:END
270 PRINT
"I
DO
NOT LIKE
MY
COMPUTER BECAUSE
"5
C$
Notice
that
when
line
210
is
executed,
a
question
mark
is
not displayed
after
the
statement,
"Type
in
your name."
Also,
notice
on
line
230 you
can
answer
the
question
"Why"
with
a
statement
full
of
delimiters,
commas
and
quotes.
MID$ =
Replace Portion
of String
wd$
(oldstring,
position, length)
=
replacement-string
o/tf5fr/7?ff
is
the
variabie-name
of
the
string
you
want
to
change.
pessiei
character
to
be changed.
length
is
a
numeric
expression
specifying the
number
of
characters
to
be
replaced.
replacement-string
is
a
string
expression
to
replace the specified portion
of oldstring.
Note:
if
replacement-string
is
shorter
than
length,
then the
entire
replacement-
string
This statement
lets
you
replace
any
part
of
a
string
with
a specified
new
string,
giving
you
a
powerful
string
editing
capability.
Note
that the
length of the
resultant string
is
always
the
same
as the original
string.
Examples
a$
=
"Lincoln"
in
the
examples
below:
MID$(A$,
3*
4)
=
"12345": PRINT
A$
which
returns
LH234N.
111

Advertisement

loading