Page 1 of 2

Problem with an expression condition[SOLVED]

Posted: 26 May 2013 23:24
by k2saf
Hi there!
I've a problem trying to check if a variable named "arcomm" (from AutoRemote plugin, this variable is a string) is "true" or "false". I checked that "arcomm" value is a proper string, so i can't see where the problem is.
I've used this in the expression condition:

Code: Select all

arcomm=="true";
I've tried with a script and an expression:
Script

Code: Select all

if(arcomm=="true")
{
a=true; //boolean
}
if(arcomm=="false")
{
a=false;
}
And then this expression:

Code: Select all

a
Thank your for the help, ive been like 2 hours trying to fix this, but there isn't enough documentation on the web :?

EDIT: Solved changing string values to numbers ( 1/0)

Re: Problem with an expression condition

Posted: 27 May 2013 17:12
by Martin
Hi,

Following test in a condition "Expression" works as expected:
arcomm="true";//to create the variable for the test
arcomm=="true"

Are you sure that the variable arcomm is available in the flow?
You can add a condition "Debug Dialog" in the flow to show a dialog with all variables and values available when the flow executes the condition.

Regards,
Martin

Re: Problem with an expression condition

Posted: 27 May 2013 22:47
by k2saf
The variable has the correct value, im uploading a few screencaps of the flow to dropbox. The expression still returns "false" always.

PD: thank you for the plugin support, sometimes its a bit buggy, but i don't want to use Tasker anymore :D

Edit: Here is a ZIP with the screen captures, thank you again

Re: Problem with an expression condition

Posted: 29 May 2013 08:35
by plm
Hi,
from your log I see a strange thing... that could be the cause of the error.
If you look at the expression, which should be arcomm=="true", it appears to be arcomm=="true " with a space between the e and the ". Obviously arcomm=="true" is not the same as arcomm=="true ".
See the image below:
Image

Re: Problem with an expression condition

Posted: 29 May 2013 20:15
by k2saf
I corrected that bug after posting, but the problem is still here. I've more pics about my flow, ill upload if necessary.
Im using a script before doing anything:

Code: Select all

a=arcomm
then the expression:

Code: Select all

a=="on"
*Note that i've changed the wording, i use "on" instead of "true"

Re: Problem with an expression condition

Posted: 30 May 2013 10:37
by plm
k2saf wrote:I corrected that bug after posting, but the problem is still here. I've more pics about my flow, ill upload if necessary.
Im using a script before doing anything:

Code: Select all

a=arcomm
then the expression:

Code: Select all

a="on"
*Note that i've changed the wording, i use "on" instead of "true"
The expression to be evaluated, true or false, must be written a=="on"... not a="on"

Re: Problem with an expression condition

Posted: 01 Jun 2013 04:40
by k2saf
It was a typo sorry..

Re: Problem with an expression condition

Posted: 01 Jun 2013 10:06
by plm
k2saf wrote:It was a typo sorry..
May be there is a typo also in the flow ... :D

Re: Problem with an expression condition

Posted: 02 Jun 2013 04:43
by k2saf
http://automagic4android.com/flow.php?i ... 7f508cdcd3

Here is the flow,I can't make it work, the expression always returns false. Now I'm gonna try to install again the app.

Re: Problem with an expression condition

Posted: 02 Jun 2013 16:09
by plm
Preamble ... I do not have the plugin AutoRemote you use with Automagic.
That said, the problem is not your flow but the communication between the plugin and Automagic.
In fact, if you, in the script, replace a=arcomm with a="on" (the value you expect to have) the flow ends with true. It 's obvious that the variable arcomm that is passed to Automagic hasn't (never?) the value "on"...
Finally, AutoRemote is a plugin for Tasker ... Automagic uses the architecture of Locale plugin. To my (very modest) experience not all plugins of Tasker and Locale are interchangeable, in few words... it may be that AutoRemote is not fully compatible with Automagic. You should hear the opinion of Martin...