Charmed Quark Systems, Ltd. - Support Forums and Community

Full Version: IF statement not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have done If System::Equals many times before but I am stumped on why this will not run.

Simply, I have a triggered event off my phone when connected to my network to fire a tasker task via the autoremote function.  

BUT

If System::Equals(NetworkMonitor.EricPhone, True, No Case)

   Do global action stuff for tasker if connected to home network

Else

  Do global action stuff if phone not connected to home network.

End

This does not work...Phone is connected to network and field is True but it skips the If True section and goes to the Else line.  I then added and If False statement to the Else line to see if the False would fire...nope.

Here is the full code:
If 
System::Equals
    P1=NetworkMonitor.EricPhone
    P2=True
    P3=No Case

System:Big GrinoGlobalAct
    P1=/User/Misc/SendARMsgYps
    P2="recloopvar","run"

System::WaitTimer
    P1=0
    P2=5000

System:Big GrinoGlobalAct
    P1=/User/Misc/SendARMsgYps
    P2="recloop","on"

Else

If 
System::Equals
    P1=VarDrvr.Text
    P2=False
    P3=No Case

System:Big GrinoGlobalAct
    P1=/User/Misc/SendARMsgYps
    P2="recloopvar","stop"

Else

End

End




Running version 5.07.  

Thoughts?
It's this:

Code:
If System::Equals(NetworkMonitor.EricPhone, True, No Case)

You are literally comparing the name of the field to True. You need to do this:

Code:
If System::Equals($(NetworkMonitor.EricPhone), True, No Case)

That will resolve to the actual value of the field. Where possible using the action testing dialog, which will show you the actual fleshed out results of the action. You would have seen it comparing "NetworkMonitor.EricPhone" and "True" in that If statement.

Also, use the helper button or the action parameter popup menu to select fields. It will give you the option to insert the name or a reference to the name, which makes it quick and easy to do.
Dang...that gets me everytime. Thanks. I should have known that.