## Calculating Number Values

Forum to ask for any help
rrehart
Posts: 44
Joined: Thu Sep 06, 2012 12:08 am

### Calculating Number Values

I am trying to use numbers to in a calculation, but can't seem to get the RegEx right. So:

I set a number to (x), then I set a second number to (y). Then I try to calculate the numbers into a new number (z) and it doesn't calculate. I figure I have to be doing something wrong with the RegEx.

Example:

v.X = 5
v.Y = 10

In order to get a calculated sum of 50, I have tried:

v.Z = [v.X][*][v.Y]
v.Z = [v.X[*]v.Y]
v.Z = v.X[*]v.Y
v.Z = [v.X*v.Y]

In each example, I either get a return value of 5 (v.X), or 0. What am I doing wrong?? cv27
Posts: 230
Joined: Sat Nov 24, 2012 10:15 pm

### Re: Calculating Number Values

Typical reply with questions instead of answers, sorry, but: I'm a bit confused by your reference to RegEx; I use RegEx extensively in 2-way but wasn't aware that RegEx expressions could be used in other areas such as the action editor. So, in what context are you trying to do this calculation?

If, as I would expect, you are trying to set a number in the action editor, then this is what I would have coded (not verified):
1- action type: Set a number
2- Number: v.Z
3- [v.X][*][v.Y]

DemoPad would confirm, but I suspect that the calculation operators ( [+], [-], [*]. [/] ) consider only one variable following the operator. If that's the case, then I would do:
1- Set number v.Z to [v.X]
2- Set number v.Z to [*][v.Y]

Extremely good question.