LOOKUP

Top  Previous  Next

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

 

The value can be up to 65535. 0 will return the first entry.

 

 

See also

LOOKUPSTR , DATA , LOOKDOWN

 

 

Example

$regfile = "m48def.dat"                                   ' specify the used micro

$crystal = 4000000                                         ' used crystal frequency

$baud = 19200                                               ' use baud rate

$hwstack = 32                                               ' default use 32 for the hardware stack

$swstack = 10                                               ' default use 10 for the SW stack

$framesize = 40                                             ' default use 40 for the frame space

 

Dim B1 As Byte , I As Integer

B1 = Lookup(2 , Dta)

Print B1                                                   ' Prints 3 (zero based)

 

I = Lookup(0 , Dta2)                                       ' print 1000

Print I

End

 

 

Dta:

Data 1 , 2 , 3 , 4 , 5

Dta2:

Data 1000% , 2000%