86
The
VIC
20
User
Guide
This statement assigns the value 4.17647059 to floating point variable
V.
It
is
equivalent to these three statements
90
REM
X
AND
Y
NEED
TO
BE
INITIALIZED
SEPARATELY
FOR
LATER
USE
1013
X-7.96
110
Y
..
e.5
120
V"3.24+X/Y
which could be written on one line as follows:
1013
X=7.96:Y=8.5:V
a
3.24+X/Y
Here are assignment statements that perform the Boolean operations
described earlier in this chapter.
90
REM
THESE
EXAMPLES
WERE
DESCRIBED
EARLIER
IN
THE
CHAPTER
100
A?=43
AND
1.37
2£10
Bi:
..
43
OR
137
The following example shows how a string variable could have its value
assigned using string concatenation:
1£10
Vf""COTTAGE"
200
Wf="CHEESE"
3£1£1
DPf(2)"V$+"
"+101$
4£1£1
REM
DPf(2)
IS
ASSIONED
THE
STRING
VALUE
"COTTAGE
CHEESE"
DATA
AND
READ
STATEMENTS
When a number
of
variables need
data
assignments, the DATA and
READ
statements should be used rather
than
the LET statement. Consider
the following example:
5
REM
INITIALIZE
ALL
PROGRAM
VARIABLES
10
DATA
le,20,-4,15E6
2£1
READ
A,B,C,D
The statement on line
10
lists four numeric data values. These four values are
assigned to four variables on line
20.
After the statements on lines
10
and
20
have been executed, A =
10,
B = 20, C = 4, and D =
16
X
10
6
•
If
you have one
or
more DATA statements in your program, you can
visualize them as building a "column"
of
numbers.
For
example, a DATA
statement
that
contains a list
of
ten numbers would build a ten-entry