Cant make lookup work

Peter-C

Member
I have searched the forum for more explanation of how the lookup functions work but my very simple test code fails to give me the expected result.

main:
let b0=99 'to simulate readadc result
let b1=6 'to ensure b1 has an initial value
lookup b0,(98,99,100,101),b1 'place value in b1
debug b1 'show value held in b1
pause 500
goto main 'repeat

I expected b1 to read 1 in debug but lookup fails to change the value held from its initial setting of 6. Where am I going wrong please?

Peter
ps Is there a way of preventing this forum's posts from showing all " marks as &quot: Is this a browser issue?
 
Last edited:

Peter-C

Member
Please ignore previous post, I have spotted my error, confusing lookdown and lookup. Lookdown works as expected.
Apologies, an example of being too close to see the obvious.
 

hippy

Ex-Staff (retired)
Glad it's sorted. It's often the way it goes, write it, click send, read it, the answer you've been struggling over for ages just 'pops out'.

As to " ... those are probably posts you found which were migrated from an earlier forum. Just use " now and everything should be fine.
 
Top