Download Print this page

Radio Shack TRS-80 Owner's Manual page 129

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

Advertisement

JF
ililll^lSSllSssi
210 LINE INPUT "TYPE
IN
YOUR NAME
"5
A$
220 LINE INPUT "DO YOU LIKE YOUR
COMPUTER?
"I
B*
230 LINE INPUT "WHY?
"!
C*
235 PRINT
240 PRINT
A*
:
PRINT
250
IF
B$
=
"NO"
THEN 270
2G0 PRINT
"I
LIKE
MY
COMPUTER BECAUSE
»
!
C$ ;END
270 PRINT
"I
DO
NOT LIKE
MY
COMPUTER BECAUSE
"!
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
wins
(oidsiring.
f-osiiw-. ;sncih}
-
rg&acm.zr'-^
:<..
oidstring
is
the
variaJste-name
j'
*>>?
suing
ycr:
--wi'
.':
i-i'-sr^e
position
is
the
numeric
expressioi? spesi'ying ihs
a*ir3
:
:
or
IH
?i
;
£t
character
to
be
changed.
length
is
a
numeric
expression
specifying the
rsiirrbsr si
crtarsnm
te
ne
fipri
nnrh
replacement-string
Is
3 string
expression
to
^sacs
m
sfjtc^sz
of
oidstring.
Note:
If
replacement-string
is
shorter
tea*,
/g^.
tug;-,
she entire
;'£s?8^n^
sfr//igwiil
be used.
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,
U)
=
"12345"; PRINT
A$
which
returns
LH234N.
111

Advertisement

loading

This manual is also suitable for:

Model iii