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

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
Operators – Spin Language Reference
X += 10 'Short form of X := X + 10
Here, the value of
is added to 10 and the result is stored back in
. The assignment form of
X
X
Add may also be used within expressions for intermediate results; see Intermediate
Assignments, page 253.
Positive ‘
’ (unary form of Add)
+
Positive is the unary form of Add and can be used similar to Negate except that it is never an
assignment operator. Positive is essentially ignored by the compiler, but is handy when the
sign of operands is important to emphasize. For example:
Val := +2 - A
Subtract ‘
’, ‘
-
-=
The Subtract operator subtracts two values. Subtract can be used in both variable and
constant expressions. Example:
X := Y - 5
Subtract has an assignment form,
, that uses the variable to its left as both the first operand
-=
and the result destination. For example,
X -= 10 'Short form of X := X - 10
Here, 10 is subtracted from the value of
and the result is stored back in
. The assignment
X
X
form of subtract may also be used within expressions for intermediate results; see
Intermediate Assignments, page 253.
Negate ‘
’ (unary form of Subtract)
-
Negate is the unary form of Subtract. Negate toggles the sign of the value on its right; a
positive value becomes negative and a negative value becomes positive. For example:
Val := -2 + A
Negate becomes an assignment operator when it is the sole operator to the left of a variable
on a line by itself. For example:
-A
This would negate the value of
and store the result back to
.
A
A
Page 256 · Propeller Manual v1.0

Related parts for 122-32000