Hi,
The FOR-NEXT loop uses variable j as its "counter" but then, in the Lookup2 command, you try to lookup the value that has the index of datac[j]. In other words Lookup2 returns the value in the list that datac[j] "points to".
When this code is run the first time all 40 bytes in the datac array i 0 so you will lookup the same value 40 times in a row and fill the array with that value (65). Next time around, you try to lookup the 65th value in the table but since the table doesn't have 65 entries Lookup2 won't return anything and therefor leave datat unchanged.
Does that make sense?
How about this:
Code:
LOOKUP2 j,[65,48,56,66,52,67,68,60,50,69,70,71,72,54,62,73,49 ,74,75,57,76,53,61,77,78,51,79,80,55,81,82,69],datat
datac[j] = datat
Or, for that matter...
Code:
LOOKUP2 j, [65,48,56,66,52,67,68,60,50,69,70,71,72,54,62,73,49 ,74,75,57,76,53,61,77,78,51,79,80,55,81,82,69], datac[j]
Untested but should work ;-)
Bookmarks