English
Language : 

NSB8 Datasheet, PDF (54/158 Pages) List of Unclassifed Manufacturers – BASIC interpreter for Z80 family
LET
grifo®
ITALIAN TECHNOLOGY
STATEMENT:
LET <numeric variable> = < numeric expression>
LET <string/substring variable> = <string expression>
<numeric variable> = <numeric expression>
<string/substring variable> = <string expression>
ACTION:
The value of the eexpression on the right hand site of the equal sign is assigned to the variable named
on the left side. the reserved word LET is optional, and may be omitted.
EXAMPLES:
10 X=X+1
50 LET A(X)= 6
35 LET Q+SQRT (X)+Y
20 B$=”HELLO THERE”
61 M$ (2,11)= FNN$ (“145-549-0858”)
150 LET Z$=STR$ (Q) +Z$(1,2)+”BOX”
REMARKS:
BASIC permits only one assignment per LET statement. However, several assignments may be made
on one line, as in:
10 A=0 \ B=0 \ C=0
Note, in the line 10 above, the apparent mathematical impossibility of X=X+1. However, as an
assignment, this make sense: the right hand expression is evaluated with the current value of X, and
the result obtained then become X’s new current value. X=X+N has the effect of increasing the value
of X by N. (It is sometimes easier to understand assignement if one resists reading LET statements
as “Q gets Q+1”, or “Z becomes M+173”.)
Only single variable names are legal on the left sode of an assignment (LET) statement. Also, it is
impossible to assign entire arrays with a single LET statement. Each individual element of an array
must be assigned separately.
ERROR MESSAGES:
TYPE ERROR
The type of the expression on the right side is not the same at the type of the variable on the left side.
It is illegal to assign a string value to a numeric variable, or a numeric value to a string variable.
SEE ALSO:
Section USING NUMBERS
Section USING STRINGS
Section USING ARRAYS
Page 42
NSB8
Rel. 5.10