Shop OBEX P1 Docs P2 Docs Learn Events
Check status of bit in VAR — Parallax Forums

Check status of bit in VAR

J^3J^3 Posts: 121
edited 2010-01-26 05:31 in Propeller 1
Good evening all,

I am looking for help on how to check the status of a bit in a VAR. Is there something similar to PBASIC such as myVar.BIT0?

Thanks in advance

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people that understand binary, those who do, and those who don't.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-26 05:04
    if myVar & |< bitNumber ' This succeeds if the bit is true (1)

    ifnot myVar & |< bitNumber ' This succeeds if the bit is false (0)
  • J^3J^3 Posts: 121
    edited 2010-01-26 05:31
    Thanks Mike, I appreciate the help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are 10 types of people that understand binary, those who do, and those who don't.
Sign In or Register to comment.