Positron Compiler Documentation

LookDownL

Source: Positron16 Compiler User Manual, PDF page 398

Syntax

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

Overview

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.

Parameters

Index is the variable/constant being sought. Value(s) can be a mixture of 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 65536 values may be placed between the square brackets. 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. Assignment Variable is a user define variable that holds the result of the search.

Example

Var1 = LookDownL MyWord, [ 512, MyWord1, 1024 ]
Var1 = LookDownL MyWord, < [ 10, 100, 1000 ]

Notes.

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 : Dim, cPtr8, cPtr16, cPtr32, Cread8, Cread16, Cread32, Edata, Eread,

LookDown, LookUp, LookUpL.