Hi,
Oshonsoft uses this method.
Extract from manual.
Eric
LookUp,
LOOKUP function can be used to select one from the list of Byte constants, based on the value in the index Byte variable, that is supplied as the last separated argument of the function.
The first constant in the list has index value 0.
The selected constant will be loaded into the result Byte data type variable.
If the value in the index variable goes beyond the number of constants in the list, the result variable will not be affected by the function.
Here is one small example for a 7-segment LED display:
Dim digit As Byte
Dim mask As Byte
TRISB = %00000000
loop:
For digit = 0 To 9
mask = LookUp(0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f), digit
PORTB = mask
WaitMs 1000
Next digit
Goto loop
If all constants in the list (or part of them) are ASCII values, then shorter form of the list can be created by using string arguments. For example:
mask = LookUp("ABCDEFGHIJK"), index
EDIT:
You could consider using an assembler block, ie: ASM: ..............