intel MCS BASIC-52 — Intel MCS BASIC-52 Versions 1 & 1.1 Operating and Reference Manual PDF (EN)

int e l 4.17 DESCRIPTION OF STATEMENTS STATEMENT: LET MODE: COMMAND AND/OR RUN TYPE: ASSIGNMENT The LET statement is used to assign a variable to the value of an expression. The generalized form of LET is: LET [var] = [expr] EXAMPLES: LET A = 10*SIN(B)/100 or LET A = A + 1 Note that the = sign used in the LET statement is not equality operator, but rather a "replacement" operator and that the statement should be read A is replaced by A plus one. THE WORD LET IS ALWAYS OPTIONAL, i.e. LET A = 2 is the same as A = 2 When LET is omitted the LET statement is called an IMPLIED LET. This document will use the word LET to refer to both the LET statement and the IMPLIED LET statement.

The LET statement is also used to assign the string variables, i.e: LET $(1)="THIS IS A STRING" or LET $(2)=$(1) Before Strings can be assigned the STRING [expr], [expr] STATEMENT MUST be executed, or else a MEMORY ALLOCATION ERROR will occur. SPECIAL FUNCTION VALUES can also be assigned by the LET statement. i.e.: LET IE = 82H or LET XBYTE(2000H)=5AH or LET DBYTE(25)=XBYTE(1000) - 49 -