if val < 6 AND Menu_Select = 211 then lookup val,[1,2,4,8,16,32],val
if val =>6 and val <= 11 and Menu_Select = 2112 then lookup val-6,[1,2,4,8,16,32],val
if val =>12 and Menu_Select = 2113 then lookup val-12,[1,2,4,8,16,32],val
Obviously I do not know how this code fits into your main program but here is an idea that could be of use.
Code:
WHILE val > 5
val = val - 6
wend
val = 1 << val
I am not sure about this line "val = 1 << val " just try it is all I can suggest.
Bookmarks