Periodic calculations


#1

hello,
how to start a chart every second to make periodic calculations
thank you in advance


#2

Hello Helpme33,

There are a few ways to do this, depending on what you’re trying to do here. The short answer to your specific question:
StartChart( ChartNameHere );
DelaySec( 1.0 );
loop.

Or you could just put the delay and the loop in the chart itself.

However, keep in mind that if you’re doing those calculations in a chart, all your variables are GLOBAL. You might consider moving that calculation logic into a [I]subroutine[/I]. Then you can call that subroutine in as many charts as you want, and you won’t be re-using variables at the same time (since variables in a subroutine are LOCAL). In other words, each chart that calls a subroutine has it’s own copy of that subroutine so the values used in it won’t get mixed up with the values for another chart.

I hope that makes sense!

-OptoMary