Page 1 of 1

using the advanced expression funtion

PostPosted: Sun Nov 25, 2012 5:22 am
by Albaniua
I don't even know how to say things right.
First, anywhere I could go to learn how to "set a variable to a value using an advanced expression?"

Up to now, I have been changing the value of a variable when a task is done TO a specific number or BY a specific number.
Can I change the value of a variable to the result of two other variables being multiplied?

So:
Variables
A=1
B=2
C=3

When the task is completed change the value of A (1) to 6 (multiplying B*C)

ideas?

Re: using the advanced expression funtion

PostPosted: Sun Nov 25, 2012 10:55 am
by Campbell
Have you tried setting A to expression %B% * %C%?

Re: using the advanced expression funtion

PostPosted: Mon Nov 26, 2012 4:21 pm
by Albaniua
yes, although in reality my variables are A_in, B_in, and C_in

A_in to expression %B_in% * %C_in%

do the spaces in the expression matter?

can I use the variable itself in an expression? like

set A_in to expression %A_in% * %B_in%

i'm away from the computer with the program, I'll write later what kind of error i'm getting.

Re: using the advanced expression funtion

PostPosted: Mon Nov 26, 2012 5:03 pm
by Campbell
Spaces are ignored, but makes the expression more readable. And yes, you can refer to the variable itself in the expression.

Re: using the advanced expression funtion

PostPosted: Tue Nov 27, 2012 1:41 am
by Albaniua
ok, this is what I put in:

Type of action: Change variable

Change a_in to expression %A_in% * %B_in%

A_in starts out 1
and
B_in starts out as 3

The error that I get is:

"[bad Expr iable]Op Expr "


the error occurs when I "update" the window "edit a resultant action"

Re: using the advanced expression funtion

PostPosted: Tue Nov 27, 2012 1:50 am
by Campbell
I just tried, and it worked fine for me:

v4expressions.jpg
v4expressions.jpg (29.68 KiB) Viewed 3467 times

Re: using the advanced expression funtion

PostPosted: Tue Nov 27, 2012 6:24 am
by Albaniua
ok......
I think I know why it wasn't (please notice the past term use of the verb!) working. What I did was start everything from scratch, put in the barest essentials, and of course, it worked. The problem is that the stuff that I had written before LOOKED exactly the same, but it wasn't reacting the same.

To get it to work, I went back to the variables window, deleted "A_in" and just rewrote it. I put a space between the underscore and "in", A_ in, which was very hard to see. Lately I've been writing the code/descriptions in word and then cutting and pasting. I'm pretty sure the error was written in Word, and when I transferred the info I didn't catch the error. Thanks Campbell for looking into it.

Re: using the advanced expression funtion

PostPosted: Tue Nov 27, 2012 8:43 am
by Campbell
Glad you figured it out. :)