11.07.2015 Views

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PICBASIC</strong> <strong>PLUS</strong> Compiler5.40. LOOKUPLSyntax : Variable = LOOKUPL Index , [ Value { , Value…etc } ]Overview :Operators :Example :Notes :Look up the value specified by the index and store it in variable. If theindex exceeds the highest index value of the items in the list, thenvariable remains unchanged. Works exactly the same as LOOKUP,but allows variable types or constants in the list of values.Variable may be a constant, variable, or expression. This is wherethe retrieved value will be stored.Index may be a constant of variable. This is the item number of thevalue to be retrieved from the list.Value(s) can be a mixture of 16-bit constants, string constants andvariables. A maximum of 50 values may be included in the list.DIM Var as BYTEDIM Wrd as WORDDIM Index as BYTEDIM Assign as WORDVar = 10Wrd = 1234Index = 0‘ Point to the first value in the list (WRD)Assign= LOOKUPL Index , [ Wrd , Var , 12345 ]Expressions may not be used in the Value list, although they may beused as the Index value.Because LOOKUPL is capable of processing any variable and constanttype, the code produced is a lot larger than that of LOOKUP.Therefore, if only 8-bit constants are required in the list, use LOOKUPinstead.See also :LOOKUP77Copyright Crownhill 2001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!