That's correct. You can not use LOOKUP with arrays since LOOKUP accesses static data stored in flash and not in RAM where your array is.
In the above code the string This is 16 bytes is static, stored in program memory and can not be changed at runtime. If accessing arrays (ie data in RAM) you can get the same result by doing something like:Code:i VAR Byte myByte VAR Byte For i = 0 to 15 Lookup i, ["This is 16 bytes"], myByte ' When you do this the string is stored in flash. Serout myByte NEXT
/Henrik.Code:i Var Byte myArray VAR BYTE[16] ArrayWrite myArray, ["This is 16 bytes"] ' When you do this the string is stored in RAM For i = 0 to 15 Serout myArray[i] NEXT




Bookmarks