Positron Compiler Documentation

LookUpL

Source: Positron8 Compiler User Manual, PDF page 407

Syntax

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

Variable may be a constant, variable, or expression. This is where the retrieved value will be stored. 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 85 values may be placed between the square brackets, 256 if using an 18F device.

Example

Device = 18F26K40
                                ' Select the device to compile for
Declare Xtal = 16 ' Tell the compiler the device will be operating at 16MHz
Dim Var1 as Byte
Dim Wrd as Word
Dim Index as Byte
Dim Assign as Word
Var1 = 10
Wrd = 1234
Index = 0
               ' Point to the first value in the list (Wrd)
Assign = LookUpL Index, [Wrd, 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 : Cdata, Cread, Cread8, Cread16, Cread32, Dim As Code, Edata, Eread, Ldata,

LookDown, LookDownL, LookUp, Lread, Lread8, Lread16, Lread32.