LOOKUP
Action
Returns a value from a table.

Syntax
var =LOOKUP( value, label )

Remarks

var The returned value
value A value with the index of the table
label The label where the data starts
var : Byte, Integer, Word, Long, Single.
value : Byte, Integer, Word, Long, Constant.


Difference with BASCOM LT
In BASCOM LT, the lookup function only works with byte tables.
In BASCOM-8051, you can use it with integer, word, long and single types too.

See also
LOOKUPSTR

Example


DIM b1 As Byte , I as Integer
b1 = Lookup(1, dta)
Print b1 ' Prints 2 (zero based)

I = Lookup(0,DTA2)
End

DTA:
DATA 1,2,3,4,5

DTA2: 'integer data
1000% , 2000%