1. Introducing Channels - a new way to chat with other Android users!
    Dismiss Notice

IF conditions with And/Or logic?


Last Updated:

  1. droidrcl

    droidrcl New Member This Topic's Starter

    Joined:
    Dec 2, 2012
    Messages:
    1
    Likes Received:
    0
    Is there a way to do AND/OR conditional logic? E.g. IF %variable1 ~ text1 AND %variable2 ~ text2?

    I'm looking for AND, OR, NOT

    Thanks
     

    Advertisement
  2. CodeMonkey

    CodeMonkey Well-Known Member

    Joined:
    Dec 13, 2008
    Messages:
    570
    Likes Received:
    110
    I use OR as with the following example:

    If I have a mobile data connection I set my variable %MDATA = 1.
    If I have a WiFi connection I set my variable %WDATA = 1.
    In tasks where I need a data connection I can then check with:
    IF %MDATA + %WDATA > 0

    In my experience mathematical checks are the best way of implementing these types of tests.
     

Share This Page

Loading...