EasyManua.ls Logo

Radio Shack TRS-80 Model 4 - Page 291

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...
SWAP
Examples:
B$
=
STRING$(25,
")-(")
puts a string of 25 "X"s into
B$.
PRINT
STRING$(50,
10)
prints 50 blank lines
on
the display, since
10
is
the ASCII code for a
line feed.
Sample Program
1040
CLEAR
300
1050
INPUT
"TYPE
IN
THREE
NUMBERS
BETWEEN
33
AND
159";
N
1,
N2,
N3
1060
CLS:
FOR
I = 1
TO
4:
PR
I
NT
STR
I
NG$
(20,
Nl):
NE)<T
I
1070
FOR
J = 1
TO
2:
PR
I
NT
STR
I
NG$
(40,
N2):
NEXT
J
1080
PRINT
STRING$(80,
N3)
This program prints three strings. Each string has the character
corresponding
to
one of the ASCII codes provided.
Statement
SWAP variable1, variable2
Exchanges the values of two variables.
Variables of any type may be SWAPped (integer, single precision,
double precision, string). However, both must be of the same type,
otherwise, a "Type mismatch" error results.
Either or both of the variables may
be
elements of arrays. If one or
both of the variables are non-array variables which have not been
assigned values,
an
"Illegal Function Call" error results.
Example
SWAP
Fl#,
F2#
swaps the contents of
F1
# and F2#. The contents of
F2#
are put
into
F1
#,
and the contents of
F1
# are put into F2#.
2·165

Other manuals for Radio Shack TRS-80 Model 4

Related product manuals