Tandy 1000 Basic Reference Manual page 326

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter
10 I
BASIC Keywords
Statement
SWAP varia
blel
paria ble2
Exchanges the values of 2 variables.
You may swap variables of any type (integer, single precision,
double precision, or string). However, both must be of the same
type; otherwise, a "Type mismatch" error results.
Either or both variables may be elements of arrays. If one or
both of the variables are non-array variables that have not been
assigned values, an "Illegal function call" error results.
Example
SWAP F 1 # , F 2 #
swaps the values of F1# and F2#. The contents of F2# are put
into F1#, and the contents of F1# are put into F2#.
Sample Program
1 0 A $ = " O N E
" : B $ = " A L L
" : C $ = " F O R
"
2 0 P R I N T
A $
C $
E$
30 SWAP A S ,
E $
4 0 P R I N T A $ C $
E $
When run, the program displays:
O N E FOR A L L
A L L FOR ONE
324

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents