EasyManua.ls Logo

Sharp MZ-700 - Assignment Statement (LET)

Sharp MZ-700
213 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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=2
0
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 CL
K)
=L
K+ 1 ······Invalid because
the
left side
of
the statement
is
not
an numeric variable
or
array element.
36
----
------------
----
--
----
--------------
----
------------------
----
---

Other manuals for Sharp MZ-700

Related product manuals