Sharp MZ-700 Owner's Manual page 38

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

Advertisement

2.3.4 Assignment statement
LET
Format
Function
Example
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.
1
0
A=1
0
2
0
8=20
3
0
A=A+8
4
0
PRINT A
5
0
END
RUNJ
3
0
1
0
LET
A=
1
0
2
0
LET 8=
20
3
0
LET A=A+8
4
0
PR
I
NT
A
50
END
·····
···
····· ·········
··The two programs above produce exactly
the same result.
The following are examples of incorrect use of the LET statement.
2
0
A$
=
A+ 8
··
····
Invalid because different types of variables (string and
numeric) are specified on either sides of the "=" sign.
2
0
LOG
C
L
K)
=L K+
1
····
··Invalid because the left side of the statement
is not an numeric variable or array element.
36 ---------------------------------------------------------------------

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents