Itteration over a word bits
stepup
Posts: 6
Can any one guide me to the way I can access each bit of a word.
for example:
someword var word
for x = 0 to 15 step 1
debug dec someword.bitx,cr
next
this should show each bit of the word, is there any way I can achieve this?
I thought that each word in basic stamp is an array, and I can access its bits like I access an array of bits. example:
for x = 0 to 15 step 1
debug dec someword(x),cr
next
this part does not work for me can any one tell me why?
thank you
for example:
someword var word
for x = 0 to 15 step 1
debug dec someword.bitx,cr
next
this should show each bit of the word, is there any way I can achieve this?
I thought that each word in basic stamp is an array, and I can access its bits like I access an array of bits. example:
for x = 0 to 15 step 1
debug dec someword(x),cr
next
this part does not work for me can any one tell me why?
thank you
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
is bit0 is considered as an offset?
if that is the case, what will happen if I use: Someword.bit3(x)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support