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

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
PUB
Declare a Public Method Block.
((PUB ┆ PRI))
Explanation
PUB
performs a specific function then returns a result value. This is one of six special declarations
(
Every object can contain a number of public (
can be accessed outside of the object itself and serve to make up the interface to the object.
The
methods they represent always return a value when called from elsewhere in the code.
CON
PUB
is the Public Method Block declaration. A Public Method is a section of source code that
,
SourceCodeStatements
PUB
VAR
Name
Name
Param
delimited parameters, enclosed in parentheses. Param must be globally unique, but
other methods may also use the same symbol name. Each parameter is essentially a
long variable and can be treated as such.
RValue
to the method’s built-in
methods may also use the same symbol name. The RValue (and/or
is initialized to zero (0) upon each call to the method.
LocalVar
but other methods may also use the same symbol name. All local variables are of
size long (four bytes) and are left uninitialized upon each call to the method.
Methods can contain zero or more comma-delimited local variables.
Count
array variable, with Count number of elements; each being a long in size. When later
referencing these elements, they begin with element 0 and end with element Count-1.
SourceCodeStatements
least one space, that perform the function of the method.
,
and
OBJ
,
is the desired name for the public method.
PRI
(Param
is an optional expression, enclosed in brackets, that indicates this is a local
is a parameter name (optional). Methods can contain zero or more comma-
PUB
is a name for the return value of the method (optional). This becomes an alias
is a name for a local variable (optional). LocalVar must be globally unique,
,
declarations don’t return a value themselves, but the public and private
PRI
,Param
, and
DAT
is one or more lines of executable source code, indented by at
…)
) that provide inherent structure to the Spin language.
RESULT
〉 〈
:RValue
variable. RValue must be globally unique, but other
〉 〈
PUB
| LocalVar
4: Spin Language Reference –
) and private (
[Count ]
Propeller Manual v1.0 · Page 287
PRI
〉〉 〈
) methods. Public methods
,LocalVar
RESULT
[Count ]
variable)
〉〉

Related parts for 122-32000