Positron Compiler Documentation

LookUpL

Source: Positron16 Compiler User Manual, PDF page 400

Syntax

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

Overview

Look up the value specified by the index and store it in variable. If the index exceeds the highest index value of the items in the list, then variable remains unchanged. Works exactly the same as LookUp, but allows variable types or constants in the list of values.

Parameters

Index may be a constant of variable. This is the item number of the value to be retrieved from the list. Value(s) can be a mixture of 16-bit constants, string constants and variables. A maximum of 65536 values may be placed between the square brackets. Assignment Variable is a user define variable that holds the result of the search.

Example

Device = 24HJ128GP502
                                   ' Select the device to compile for
Declare Xtal = 16
Dim Var1 as Byte
Dim MyWord as Word
Dim Index as Byte
Dim Assign as Word
Var1 = 10
MyWord = 1234
Index = 0
                    ' Point to the first value in the list (MyWord)
Assign = LookUpL Index, [MyWord, Var1, 12345]

Notes.

Expressions may not be used in the Value list, although they may be used as the Index value.

Because LookUpL is capable of processing any variable and constant type, the code produced is a lot larger than that of LookUp. Therefore, if only 8-bit constants are required in the list, use LookUp instead.

See also : Dim, cPtr8, cPtr16, cPtr24, cPtr32, Cread8, Cread16, Cread24, Cread32,

Edata, Eread, LookDown, LookDownL, LookUp.