Shop OBEX P1 Docs P2 Docs Learn Events
Bitwise AND NOT opperator problems — Parallax Forums

Bitwise AND NOT opperator problems

linkdefenderlinkdefender Posts: 1
edited 2004-12-10 23:06 in Learn with BlocklyProp
Im trying to use the AND NOT ( &/ )·opperator for·P basic 2.5 but every time i try and run the program i end up getting the '/' highlighted and an error that says 'expected constant, variable, unary operator, or ')''

Does anyone know why im getting this error, it doesnt make any sense to me why its not accepting the opperator &/

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2004-12-10 21:10
    linkdefender -

    I can confirm your results, and would guess that it may be a genuine bug. Very unusual to find such things, in my experience.

    The same seems to be true of the other similar operator: OR NOT |/

    Bruce Bates
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-12-10 22:15
    Not a bug -- those operators only work in PBASIC 1.0 (BS1).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2004-12-10 23:06
    The NOT operator for the Stamp 2 is "~" tilde.
    Example:
    Z = ~ X ' complement the bits of X
    Y = X & ~ mask ' AND X with complement of mask

    The Stamp evaluates the unary ~ before the binary &.

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