Specifications
BASIC Stamp I and Stamp II Conversions
Page 406 • BASIC Stamp Programming Manual 1.8 • Parallax, Inc.
IF...THEN
BASIC STAMP I
IF variable ?? value {AND/OR variable ?? value...} THEN label
• VARIABLE is a bit, byte or word variable. No constants are al-
lowed.
• ?? is =, <>, >, <, >=, <=.
• VALUE is a constant or a bit, byte, or word variable.
• LABEL is a location to branch to if the result is true.
BASIC STAMP II
IF conditionalexpression THEN label
• CONDITIONALEXPRESSION is any valid Boolean expression us-
ing the =, <>, >, <, >=, <=, conditional operators and the AND,
OR, NOT, and XOR logical operators.
• LABEL is a location to branch to if the result is true.
CONVERSION: BS1 R BS2
1.If VARIABLE is PINS or PIN0..PIN7 then replace in with INS or
IN0..IN7.
CONVERSION: BS1 Q BS2
1.If the INS or OUTS symbol is specified to the left of the conditional
operator, replace it with PINS.
2.If the logical operator NOT is specified, remove it and switch the
conditional operator to negative logic.
3.If one of the values is an expression, you must perform the calcula-
tion in a dummy variable outside of the IF...THEN statement.
Example:
BS2: IF NOT FirstValue > LastValue * (2 + NextValue) THEN Loop
BS1: Temp = 2 + NextValue * LastValue
IF FirstValue <= Temp THEN Loop










