Positron Compiler Documentation

LookDownL

Positron8 · Revision 4.0.6.5 · PDF page 405

Variable = LookDownL Index, {Operator} [ Value {, Value…etc } ]

A comparison is made between index and value; if the result is true, 0 is written into variable. If that comparison was false, another comparison is made between value and value1; if the result is true, 1 is written into variable. This process continues until a true is yielded, at which time the index is written into variable, or until all entries are exhausted, in which case variable is unaffected.

Variable is a user define variable that holds the result of the search. Index is the variable/constant being sought. Value(s) can be a mixture of 16-bit constants, string constants and variables. Expressions may not be used in the Value list, although they may be used as the index value. A maximum of 85 values may be placed between the square brackets, 256 if using an 18F device. Operator is an optional comparison operator and may be one of the following: -

= equal

<> not equal

>greater than
<less than

>= greater than or equal to <= less than or equal to

The optional Operator can be used to perform a test for other than equal to ("=") while searching the list. For example, the list could be searched for the first Value greater than the index parameter by using ">" as the Operator. If Operator is left out, "=" is assumed.

Var1 = LookDownL Wrd, [ 512, Wrd1, 1024 ]
Var1 = LookDownL Wrd, < [ 10, 100, 1000 ]

Because LookDownL is more versatile than the standard LookDown command, it generates larger code. Therefore, if the search list is made up only of 8-bit constants and strings, use LookDown.

See also : Cdata, Cread, Cread8, Cread16, Cread32, Edata, Eread, Ldata, LookDown, LookUp, LookUpL, Lread, Lread8, Lread16, Lread32.

View original PDF page 405Open page in PDFOriginal PDF page 405