122-32000 Parallax Inc, 122-32000 Datasheet - Page 224

MANUAL PROPELLER

122-32000

Manufacturer Part Number
122-32000
Description
MANUAL PROPELLER
Manufacturer
Parallax Inc
Datasheets

Specifications of 122-32000

Accessory Type
Manual
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
Propeller Education (PE) Kit
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
We did this below:
The above example contains an error because, while
90
first, and since it is true, its block is executed and no further conditions of that
are tested. If
be true.
Using IF with ELSEIF and ELSE
Another form of the
of many different conditions is true, or an alternate action if none of the previous conditions
were true. This is written as with an
example:
This is just like the example above, except that if none of the
P3 is toggled.
The ELSEIFNOT Condition
The
executes its ElseIfNotStatement(s) block only if its Condition(s) expression evaluates to
FALSE
command, in any order, between the
Page 224 · Propeller Manual v1.0
if X > 100
elseif X > 50
elseif X == 90
if X > 100
elseif X == 90
elseif X > 50
else
statement would never be tested because the previous one,
ELSEIFNOT
– Spin Language Reference
!outa[0]
!outa[2]
!outa[1]
!outa[0]
!outa[1]
!outa[2]
!outa[3]
. Multiple
X
were 50 or less, the last
condition behaves exactly like
ELSEIFNOT
IF
conditional command performs one of many different actions if one
and
ELSEIF
IF
IF
'If X is greater than 100
'Toggle P0
'Else If X > 50
'Toggle P2
'Else If X = 90 <-- ERROR, ABOVE COND.
'Toggle P1
'
'If X is greater than 100
'Toggle P0
'Else If X = 90
'Toggle P1
'Else If X > 50
'Toggle P2
'Otherwise,
'Toggle P3
, one or more
conditions can be combined in a single
and the optional
ELSEIF
condition is tested, but of course, it will never
ELSEIF
X
ELSEIFs
could be equal to 90, the
except that it uses negative logic; it
ELSE
.
<-- SUPERSEDES THIS AND
IF
elseif X > 50
, and finally an
or
THIS CODE NEVER RUNS
ELSEIF
conditions are true,
, would be tested
ELSE
IF
elseif X ==
IF
. Here’s an
conditional
structure

Related parts for 122-32000