1. Check out our companion app, Forums for Android! Download from Google Play

IF conditions with And/Or logic?

Discussion in 'Android Apps & Games' started by droidrcl, Dec 2, 2012.

  1. droidrcl

    droidrcl New Member
    Thread Starter
    5

    Dec 2, 2012
    1
    0
    5
    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
    93

    Dec 13, 2008
    570
    110
    93
    Software Developer
    On the sofa
    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...