if, then, else, how about AND?


    Feb 19 2008 | 7:58 am
    I've bumped into this problem a few times, and the limitations of the expr object seriously can annoy when i need an AND statement ment in there.
    does anyone know an easy way of achieving this?
    Thanks for any help.

    • Feb 19 2008 | 8:24 am
    • Feb 19 2008 | 9:14 am
      yeah thats right. does that work? because if it does it isn't in my manual!
      thanks for the reply.
    • Feb 19 2008 | 10:32 am
      I searched for this functionality before, didn't know [if] could do it. Thanks!
      We need more examples...
    • Feb 19 2008 | 2:50 pm
      This seems to have worked for my needs...
      Using the if/then/else object...
      if (($f1 > $f2) &&( $f1 > $f3)) then send Test bang
      Hope that helps...
      I was hoping to do nested if/then/else statements, but instead had to split them up over a few objects instead.
    • Feb 20 2008 | 5:05 pm
      Max uses C-syntax throughout expr and if and sprintf and a bunch of other places. C-syntax is '&&'. 'AND' is sort of COBOL or SQL or Pascal. And what's the object called that does 'logical and'?
      It might be helpful if the documentation made this explicit in every single place, but in the meantime it's something to look out for and get used to. It's also been discussed on the list dozens of times. At least now you know;-
    • Feb 21 2008 | 12:41 am
      Quote: Peter Castine wrote on Wed, 20 February 2008 18:05
      ----------------------------------------------------
      And what's the object called that does 'logical and'?
      logical and [&&]
      bitwise and [&]
      || am i not understanding you Peter? :)
      regards,
      kjg
    • Feb 21 2008 | 1:53 pm
      One should never answer rhetorical questions.
    • Feb 21 2008 | 9:55 pm
      is it possible to use sprintf or expr or something else to compare if two symbols are equal and then produce an output?
    • Feb 21 2008 | 10:02 pm
      What are the symbols...?
      Strings, numbers?
      If numbers, you can use == comparison operator
      For string, you could try jasch strcmp external...
    • Feb 21 2008 | 10:21 pm
      [select] ?
      Quote: blairell wrote on Thu, 21 February 2008 22:55
      ----------------------------------------------------
      > is it possible to use sprintf or expr or something else to compare if two symbols are equal and then produce an output?
      ----------------------------------------------------
    • Feb 21 2008 | 10:39 pm
      and of course [match] and [route] :
    • Feb 21 2008 | 10:55 pm
      the first example doesn't compare if two strings are equal, it just sets an output based on if an input equals a predefined result.
      the shampoo/dandruf example is close, but a bit dangerous because it doesn't have split inputs, so if a string get sent from the same source twice it will return true when it probably shouldn't. but with a bith of fiddling it will work! thanks
    • Feb 21 2008 | 11:20 pm
      o ok i see
      an other solution would be to convert characters into into integers using [atoi] and compare the resulting list of numbers.
      [L==] from Peter Elsea's set is handy for that.
      [vexpr] does logical operations as well
      Quote: blairell wrote on Thu, 21 February 2008 23:55
      ----------------------------------------------------
      > the first example doesn't compare if two strings are equal, it just sets an output based on if an input equals a predefined result.
      >
      > the shampoo/dandruf example is close, but a bit dangerous because it doesn't have split inputs, so if a string get sent from the same source twice it will return true when it probably shouldn't. but with a bith of fiddling it will work! thanks
      ----------------------------------------------------
    • Feb 22 2008 | 4:35 am
      ahh nice idea. ill give that a shot!