[if $i1 == 59 & $i2 == 127 then 0 else 1] not working as I expected.


    Jun 12 2018 | 10:29 pm
    Hello,
    I'm wondering if there's a more elegant way of going about this, because what I thought would work is not working. I'm interested to know why it's not working, too.
    Thanks in advance, John Baylies

    • Jun 12 2018 | 10:57 pm
      It seems to work for me, John. It's hard to tell from the movie, but $i2 (i.e. 127) needs to be received first. Using a bondo object first means the 2 numbers can be in either order. HTH.
    • Jun 12 2018 | 11:50 pm
      Shouldn't the logical AND operator be "&&" instead of &? If that's what you want. Notwithstanding use of bondo as suggested.
    • Jun 13 2018 | 2:17 am
      @Floating Point: Yeah, that's what I thought, too, but it works both ways. Strange...
    • Jun 13 2018 | 10:29 am
      OK in this case bitwise works the same as logical, because the intermediate results of the sub-expressions output single bits (either 0 or 1). Anyway here's two possible solutions to the op's problem (addressing message order with bondo or trigger). Note I used expr instead of the if object as it's a little more succinct...
    • Jun 13 2018 | 4:11 pm
      Beautiful. Thanks guys!
    • Jun 13 2018 | 8:31 pm
      @Floating Point: Thanks for that. You've made it very neat, efficient and - more importantly - explicable.
    • Jun 13 2018 | 8:37 pm
      pak 0 0 into the first inlet should also solve the issue.