Problem with an expression condition[SOLVED]

Post your questions and help other users.

Moderator: Martin

k2saf
Posts: 11
Joined: 26 May 2013 20:47

Problem with an expression condition[SOLVED]

Post by k2saf » 26 May 2013 23:24

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)
Last edited by k2saf on 03 Jun 2013 17:00, edited 1 time in total.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Problem with an expression condition

Post by Martin » 27 May 2013 17:12

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

k2saf
Posts: 11
Joined: 26 May 2013 20:47

Re: Problem with an expression condition

Post by k2saf » 27 May 2013 22:47

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
Attachments
2013-05-28 00.42.08.png
2013-05-28 00.42.08.png (408.43 KiB) Viewed 28298 times
2013-05-28 00.46.35.png
2013-05-28 00.46.35.png (246.56 KiB) Viewed 28298 times
2013-05-28 00.42.21.png
2013-05-28 00.42.21.png (464.88 KiB) Viewed 28298 times

plm
Posts: 19
Joined: 06 May 2013 22:27

Re: Problem with an expression condition

Post by plm » 29 May 2013 08:35

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

k2saf
Posts: 11
Joined: 26 May 2013 20:47

Re: Problem with an expression condition

Post by k2saf » 29 May 2013 20:15

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"
Last edited by k2saf on 01 Jun 2013 04:41, edited 3 times in total.

plm
Posts: 19
Joined: 06 May 2013 22:27

Re: Problem with an expression condition

Post by plm » 30 May 2013 10:37

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"

k2saf
Posts: 11
Joined: 26 May 2013 20:47

Re: Problem with an expression condition

Post by k2saf » 01 Jun 2013 04:40

It was a typo sorry..

plm
Posts: 19
Joined: 06 May 2013 22:27

Re: Problem with an expression condition

Post by plm » 01 Jun 2013 10:06

k2saf wrote:It was a typo sorry..
May be there is a typo also in the flow ... :D

k2saf
Posts: 11
Joined: 26 May 2013 20:47

Re: Problem with an expression condition

Post by k2saf » 02 Jun 2013 04:43

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.

plm
Posts: 19
Joined: 06 May 2013 22:27

Re: Problem with an expression condition

Post by plm » 02 Jun 2013 16:09

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

Post Reply