Hello,
I am trying to get a sum of a varying number of values - there can be anywhere from one to eight. The values are already stored in variables:
TimeLineTotal1
TimeLineTotal2
TimeLineTotal3
...
TimeLineTotal(n)
So I created a Repeat block that will be repeating n times.
I have a Counter variable running from 1 to n
I have a variable TimeRunningTotal that will be used to accumulate the sum of the times.
During each loop, I need:
TimeRunningTotal = TimeRunningTotal + TimeLineTotal(x)
"(x)" being the current value of Counter
I had thought a "Set Variable to Calculation" step looking something like this would work:
TimeRunningTotal = TimeRunningTotal + TimeLineTotal%Variable%Counter%
So in, say, the 2nd loop, when Counter = 2 I would get:
TimeRunningTotal = TimeRunningTotal + TimeLineTotal2
BUT, the Set Variable to Calculation step doesn't like the
TimeLineTotal%Variable%Counter%
How can I calculate with a variable that needs to be referred to dynamically like this?
Thanks!
- eric