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

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
RESULT
The return value variable for methods.
((PUB ┆ PRI))
Explanation
The
holds the method’s return value; the value passed back to the caller of the method, when the
method is terminated.
When a public or private method is called, its built-in
If that method does not alter
then zero will be the return value upon that method’s termination.
Using RESULT
In the example below, the
method calls
DoSomething
PUB Main | Temp
PUB DoSomething
You can also provide an alias name for a method’s
clear what the method returns. This is highly recommended since it makes a method’s intent
more easily discerned. For example:
PUB GetChar : Char
The above method,
page 287 or
task to get a character then it sets
RESULT
Temp := DoSomething
<do something here>
result := 100
<do something>
Char := <retrieved character>
RESULT
variable is a pre-defined local variable for each
PRI
exits,
DoSomething
, page 286, for more information. The
Temp
GetChar
will be set to 100
DoSomething
and sets its local variable,
, declares
RESULT
Char
'Call DoSomething, set Temp to return value
'Set result to 100
, or does not call
Char
4: Spin Language Reference –
method sets
to the value of the retrieved character. It could have
as an alias for its built-in
'Set Char (result) to the character
RESULT
RESULT
RETURN
Temp
RESULT
GetChar
, equal to the result; so that when
variable in order to make it more
equal to 100 at its end. The
or
Propeller Manual v1.0 · Page 299
variable is cleared to zero (0).
PUB
ABORT
method then performs some
and
RESULT
with a value specified,
PRI
variable; see
method.
RESULT
Main
PUB
,

Related parts for 122-32000