Specifications
Appendix C
Parallax, Inc. • BASIC Stamp Programming Manual 1.8 • Page 399
C
FOR...NEXT
BASIC STAMP I
FOR variable = start TO end {STEP {-} stepval}...NEXT {variable}
• Up to 8 nested FOR...NEXT loops are allowed.
• VARIABLE is a bit, byte or word variable.
• START is a constant or a bit, byte or word variable.
• END is a constant or a bit, byte or word variable.
• STEPVAL is a constant or a bit, byte or word variable.
• VARIABLE (after NEXT) must be the same as VARIABLE
(after FOR).
BASIC STAMP II
FOR variable = start TO end {STEP stepval}...NEXT
• Up to 16 nested FOR...NEXT loops are allowed.
• VARIABLE is a bit, nibble, byte or word variable.
• START is a constant, expression or a bit, nibble, byte or word
variable.
• END is a constant, expression or a bit, nibble, byte or word
variable.
• STEPVAL is an optional constant, expression or a bit, nibble, byte
or word variable and must be positive.
CONVERSION: BS1 R BS2
1. Remove the minus sign “-“ from the step value if given. The Stamp
II dynamically determines the direction at run-time depending on
the order of START and END. This allows for great flexibility in
programming.










