Shop OBEX P1 Docs P2 Docs Learn Events
AND function help — Parallax Forums

AND function help

El PaisaEl Paisa Posts: 375
edited 2006-02-18 18:14 in BASIC Stamp
It is possible in Pbasic this expression?
Btn = K AND &H3F
Thanks in advanced.

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-02-18 17:15
    If it "tokenizes" then it's possible.· What's the deal?
    ·
  • El PaisaEl Paisa Posts: 375
    edited 2006-02-18 17:43
    apparently Pbasic only allows something like:
    if K AND &H3F then goto (gosub) nnn

    My question is how you code·· Btn = K AND &H3F·in Pbasic
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2006-02-18 18:14
    BTN = K & $3f

    The operator & is Stampese bitwise AND in expressions.

    The $ designates a HEX value.

    The help menu shows this in the section of math operators.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.