Propeller Manual

Table Of Contents
2: Spin Language Reference – IFNOT
Propeller Manual v1.1 · Page 117
IFNOT
Command: Test condition(s) and execute a block of code if valid (negative logic).
((PUB PRI))
IFNOT Condition(s)
IfNotStatement(s)
ELSEIF Condition(s)
ElseIfStatement(s)
ELSEIFNOT Condition(s)
ElseIfNotStatement(s)
ELSE
ElseStatement(s)
Condition(s) is one or more Boolean expressions to test.
IfNotStatement(s) is a block of one or more lines of code to execute when the IFNOT’s
Condition(s) is false.
T
ElseIfStatement(s) is an optional block of one or more lines of code to execute when all
the previous Condition(s) are invalid and the
ELSEIF’s Condition(s) is true.
ElseIfNotStatement(s) is an optional block of one or more lines of code to execute when
all the previous Condition(s) are invalid and the
ELSEIFNOT’s Condition(s) is false.
ElseStatement(s) is an optional block of one or more lines of code to execute when all
the previous Condition(s) are invalid.
Explanation
IFNOT is one of the three major conditional commands (T IF, IFNOTT, and CASE) that conditionally
executes a block of code.
IFNOT is the complementary (negative) form of T IF.
IFNOT tests Condition(s) and, if false, executes IfNotStatement(s). If Condition(s) is true, the
following optional
T
ELSEIF Condition(s), and/or ELSEIFNOT Condition(s), are tested, in order,
until a valid condition line is found, then the associated ElseIfStatement(s), or
ElseIfNotStatement(s), block is executed. The optional ElseStatement(s) block is executed if
no previous valid condition lines are found.
A “valid” condition is one that evaluates to
FALSE for a negative conditional statement (IFNOT,
or
ELSEIFNOT) or evaluates to TRUE for a positive conditional statement (ELSEIF).
See
IF on page 112 for information on the optional components of IFNOT. T