LET (Assignment Statement)
I
LET
I variable=- expression
The
LET
statement
allows
you
to
assign
valuc.s
to
variables
in yow-
program.
The
computer evaluates the expression to the right of the
equals sign
and
puts its value into the variable specified to the left
of
the
equals
sign.
The
variable
and
the expression must correspond in type:
numeric expressions must be assigned
to
numeric variables;
string
expressions must be assigned to
string
variables.
The
rules
governing overflow and underflow
for
the evaluation of a numeric
expression
are
used
in
the
LET
statement.
See
"Numeric
Constants" for a full explanation.
If
the length of an evaluated
string
expression exceeds 255 characters, the string
is
truncated
on the
rig:ht, and the program continues. No warning is given.
You
may use relational operators
In
numeric and
stnng
expreSSlOns.
The
result of a relational operator
is
-1 if the relationship
is
true
and
is
0 if the relationship is false.
User's Reference Guide
Examples:
>NEW
>100
LET
1'1"'1000
>110
LET
("'186000
,)'120 E=I'I*(1\2
>130 PRINT E
>140
END
>RUN
:5.4596E+1:5
**
DONE
**
>N
EW
;.100
LET
X$="HELLO, "
>110 NAME$="GENIUS!"
>120
PRINT X$;NAI'IE$
>130
END
>RUN
HELLO,
GENIUS!
**
DONE
**
>NE\<iI
>100
LET
A=20
>110 B=10
>120
LET
C=A>B
>130
PRINT
A;B;C
>140
C=A<B
>150
PRINT
A;B;C
>160
END
>RUN
20
10-1
20 10 0
**
DONE
**
IIĀ·45