84
Notes
About
LET
• Data values
to
the
right
of
the
equal sign must be
of
the
same
type
(arithmetic
or character) as
the
variables
to
which they are assigned.
• The keyword LET
is
optional.
• Hexadecimal constants can also be assigned
to
character variables
in
LET state·
ments. The constant must begin with X' followed by an even number
of
char·
acters
0
to
9 and A
to
F. The end
of
the constant must be indicated by a single
quotation mark (').
• Subscripted references
to
array elements are permitted
in
the assignment
statement.
• The maximum number
of
variables
to
the left
of
the
equal sign
in
a multiple
assignment statement
is
limited only by the line size (64 characters).
Example
Some sample LET statements are as shown:
10 LET
Z$
= 'CAT'
20
LET X = 9
30
LET
V(X) = 2
40
V(X), X =
XIV
(X)
50
LET A$ = X'0201130903'
After execution
of
statement 10,
the
character variable Z$ will contain
the
word
CAT followed by
15
blank characters.
After execution
of
statement 30,
the
ninth member of the one·dimensional arith·
metic array
(V)
will have
the
integer value 2.
After execution
of
statement 40,
the
arithmetic variable X
will
have
the
decimal
value 4.5. The ninth member
of
the
one·dimensional arithmetic array V will have
the
decimal value 4.5. The action
of
statement
40
is
to
first evaluate
the
expression
on
the
right according
to
the
current values
of
the variables V(X) and
X,
2, and 9,
respectively. The resulting value, 4.5,
is
first assigned
to
V(9), then
to
the
variable
X.
After execution
of
statement 50,
the
variable A$ will contain the hexadecimal con·
stant listed (see Appendix E for hexadecimal representations).
/~
/