|
Macro Toolworks Products Discussion Forums :: General Discussion |
|
|
|
|
|
Subject :Need help: calculating..
27-10-2011 00:04:13
|
|
|
| breeckx@cool.la |
|
Joined: 26-10-2011 21:55:50
Posts: 8
Location: |
|
|
|
|
|
Hi @ll!
I am testing the macro tools software.
I tried to calculate with a few variables.
Can someone Tell me how I am able to add three variables?
example: var1=5+var2=5+var3=7
I tried this with <var_oper> -> CALC_EXPRESSION but the third variable is ignored
Thank you very much! |
IP Logged
|
|
|
|
|
|
|
Subject :Re:Need help: calculating..
27-10-2011 14:22:55
|
|
|
| petr |
|
Joined: 15-10-2009 11:48:52
Posts: 152
Location: |
|
|
|
|
|
Hello,
if you want to do this:
var1 = 5+(var2=(5+(var3=7))) so that variables content is:
var1=17
var2=12
var3=7
then you cannot do this in a single <var_oper> command. You need to do something like this:
<cmds>
<varset>("var3=7","")
<var_oper>(var2,"5+%var3%",CALC_EXPRESSION,"0","", "0")
<var_oper>(var1,"5+%var2%",CALC_EXPRESSION,"0","", "0")
<msg>(-100,-100,"variable 1 = %var1%
variable 2 = %var2%
variable 3 = %var3%
","Result",1,0,0,1)
Best regards,
Petr |
IP Logged
|
|
|
|
|
|
|
Subject :Re:Need help: calculating..
27-10-2011 16:41:09
|
|
|
| breeckx@cool.la |
|
Joined: 26-10-2011 21:55:50
Posts: 8
Location: |
|
|
|
|
|
hi, thank you very much for your response!
I tink I did not write correctly what I want to do... Sorry
I simply want to add three numeric variables. A+B+C
Do you have a hint for this too?
Regards
Breeckx |
IP Logged
|
|
Last Edited On: 27-10-2011 16:51:19 By breeckx@cool.la for the Reason |
|
|
|
|
|
|
Subject :Re:Need help: calculating..
31-10-2011 21:50:55
|
|
|
| petr |
|
Joined: 15-10-2009 11:48:52
Posts: 152
Location: |
|
|
|
|
|
Hello,
here is the example:
<cmds>
<varset>("var1=10","")
<varset>("var2=20","")
<varset>("var3=30","")
<var_oper>(varResult,"%var1%+%var2%+%var3%",CALC_EXPRESSION,"0","", "0")
<msg>(-100,-100,"Result=%varResult% ","Result",1,0,0,1)
Best regards,
Petr |
IP Logged
|
|
|
|
|
|
|
Subject :Re:Need help: calculating..
31-10-2011 22:04:06
|
|
|
| breeckx@cool.la |
|
Joined: 26-10-2011 21:55:50
Posts: 8
Location: |
|
|
|
|
|
Thank you for this example.
But The result is 30 not 60. The third variable is not used.
This is the problem I tried to explain in the first posting. Any idea? |
IP Logged
|
|
|
|
|
|
|
Subject :Re:Need help: calculating..
31-10-2011 22:17:37
|
|
|
| petr |
|
Joined: 15-10-2009 11:48:52
Posts: 152
Location: |
|
|
|
|
|
|
I have tested it in latest version 7.4.8 and it correctly shows result 60. Do you also use the latest version 7.4.8? |
IP Logged
|
|
|
|
|
|
|
Subject :Re:Need help: calculating..
31-10-2011 23:56:50
|
|
|
| hugblue@hotmail.com |
|
Joined: 13-10-2010 01:09:07
Posts: 100
Location: sweden |
|
|
|
|
i also run it in 7.4.8
and theres absolutely no problems.
works like a dream. |
IP Logged
|
|
|
|
|