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

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
LOOKDOWN, LOOKDOWNZ
Get the index of a value in a list.
((PUB ┆ PRI))
((PUB ┆ PRI))
Returns: One-based index position (
Value in ExpressionList, or 0 if Value not found.
Explanation
LOOKDOWN
LOOKDOWN
LOOKDOWNZ
both commands, if Value is not found in ExpressionList then 0 is returned.
Using LOOKDOWN or LOOKDOWNZ
LOOKDOWN
18, etc.) to a set of contiguous numbers (1, 2, 3, etc. –or– 0, 1, 2, etc.) where no algebraic
expression can be found to do so concisely. The following example assumes
method created elsewhere.
PUB ShowList | Index
PUB GetIndex(Value): Index
Page 242 · Propeller Manual v1.0
LOOKDOWN
LOOKDOWNZ
Print(GetIndex(25))
Print(GetIndex(300))
Print(GetIndex(2510))
Print(GetIndex(163))
Print(GetIndex(17))
Print(GetIndex(8000))
Print(GetIndex(3))
Index := lookdown(Value: 25, 300, 2_510, 163, 17, 8_000, 3)
Value
ExpressionList
are also allowed; they are treated as a comma-separated list of characters.
and
and
returns the one-based index position (1..N) of Value from ExpressionList.
is just like
is an expression indicating the value to find in ExpressionList.
( Value : ExpressionList )
LOOKDOWNZ
LOOKDOWNZ
( Value : ExpressionList )
is a comma-separated list of expressions. Quoted strings of characters
LOOKDOWN
are commands that retrieve indexes of values from a list of values.
are useful for mapping a set of non-contiguous numbers (25, -103,
except it returns the zero-based index position (0..N−1). For
LOOKDOWN
– Spin Language Reference
) or a zero-based index position (
LOOKDOWNZ
Print
is a
) of

Related parts for 122-32000