BASIC stamp manual v2.2
5: BASIC Stamp Command Reference – LET
BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com • Page 269
LET
BS1 BS2 BS2e BS2sx BS2p BS2pe BS2px
{ LET } Variable = Value
Function
Sets Variable equal to the value of Value.
• Value is a variable/constant/expression. (0-65535).
• Variable is a variable which will be set equal to Value.
Explanation
LET is an optional instruction for the BASIC Stamp 1 that can be used with
variable assignment statements, such as A = 5 and B = A + 2, etc. This
instruction is not required and only exists on the BASIC Stamp 1. LET was
a commonly used command in early forms of BASIC, and was originally
included in the BS1 command set to accommodate programmers from that
generation. Parallax recommends that all new BASIC Stamp 1 programs
use assignment statements without the LET command.
Demo Program (LET.bs1)
' LET.bs1
' This example demonstrates the use of LET in assignment statements, which
' is optional and not recommended. Note that the Lunchtime and
' Dinnertime routines do essentially the same thing, but the Dinnertime
' method is recommended(even though the pricing scheme is not!)
' {$PBASIC 1.0}
' {$STAMP BS1}
SYMBOL salad = B1
SYMBOL bread = B2
SYMBOL soup = B3
SYMBOL lunch = B4
SYMBOL dinner = B5
Lunchtime:
LET salad = 3
LET bread = 1
LET soup = 4
LUNCH = salad + bread + soup
DEBUG "lunch = $", #lunch, "plus local tax.", CR
Dinnertime:
salad = 4
bread = 2
soup = 5
1
1