Sharp MZ-700 Series Owner's Manual page 38

Personal computer
Hide thumbs Also See for MZ-700 Series:
Table of Contents

Advertisement

2.3.4 Assignment statement
LET
Format
Function
LET v = e or v = e
v . . . Numeric variable or array element, or string variable or array element.
e . . . Numeric expression (consisting of one or more constants, variables, or array
elements) or string expression (consisting of one or more constants, variables,
or array elements).
This statement assigns the value (numeric or string) specified by e to the variable
or array element specified by v. As shown in the examples below, LET may be
omitted.
Example
1 0 A = 1 0
1 0 L E T
2 0
B = 2 0
2 0
L E T
3 0
A = A + B
3 0
L E T
4 0
P R I N T
A
4 0
P R I N
5 0
E N D
5 0
E N D
R U N J
30
The two programs above produce exactly
the same result.
The following are examples of incorrect use of the LET statement.
2 0
A $ = A + B
Invalid because different types of variables (string and
numeric) are specified on either sides of the " = " sign.
2 0
L O G ( L K ) = L K + 1
Invalid because the left side of the statement
is not an numeric variable or array element.

Advertisement

Table of Contents
loading

Table of Contents