1. Download our Official Android App: Forums for Android!

IF conditions with And/Or logic?

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

  1. droidrcl

    droidrcl Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Dec 2, 2012

    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 Guest
    Rank:
    None
    Posts:
    0
    Joined:

    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...