EasyManuals Logo

Parallax BASIC Stamp II User Manual

Default Icon
68 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #26 background imageLoading...
Page #26 background image
Page 26 • BASIC Stamp II Manual 0.94 • Parallax, Inc. • (916) 624-8333
BASIC Stamp II
are resolved left-to-right, parentheses can override priority:
X+1*Y-1 ‘something’s wrong here if we need (X+1)*(Y-1)
(X+1)*(Y-1) ‘do it right
Up to 8 levels of parentheses can be used.
For use within conditional expressions (IF), there is a special unary
operator and several binary operators. These conditional operators have
highest priority of all.
NOT Highest priority unary
AND, OR, XOR Highest priority binaries
Note: These are arithmetically identical to expression operators:
~
&
|
^
though they differ in application.
Lower-priority conditional binary operators (still higher than expres-
sion ops):
< Less than
<= Less than or equal to
= Equal to
=> Equal to or greater than
> Greater than
<> Not equal
Note: These comparison operators return 0 for false and $FFFF for
true. Combined with NOT, AND, OR, and XOR, complex tests can be
done.
To summarize, here are some examples:
outs = ~ dcd nibarray(index) ‘lookup a nibble, decode it, not it
IF x<1 or not y>3 and (z=0 xor r=3) then loopback

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Parallax BASIC Stamp II and is the answer not in the manual?

Parallax BASIC Stamp II Specifications

General IconGeneral
BrandParallax
ModelBASIC Stamp II
CategoryMicrocontrollers
LanguageEnglish