infinite loop
Created at 13 Nov 2017, 15:52
infinite loop
13 Nov 2017, 15:52
Hi ,
I was testing a bit of code, and got stuck in an infinite "WHILE LOOP"...
... and as the code was applied to a chart, Calgo became irresponsive. I had to kill the task and manually delete the files in the cAlgo\sources\Indicators\... folder.
Is there a quicker way 'out of infinity' than kill_task/delete file ? :)
...or do i just need to add a failsafe inside the WHILE condition that could look like :
var failsafe = 5000; var i = 1; ... while (condition && i < failsafe) { // some code here ... i++; }
Thanks for any help.
PanagiotisCharalampous
20 Nov 2017, 11:03
Hi zendoo,
Your question is very general for somebody to give a more specific answer to it. In principle, you should write your code in a way that it does not fall into infinite loops. If you could share your code with us then we could maybe give you a more specific advice.
Best Regards,
Panagiotis
@PanagiotisCharalampous