[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

while/for loop infinite (time out) "runtime errors"



PureBytes Links

Trading Reference Links

To my horror, I discovered that EasyLanguage takes the ridiculous while/for 
loop time-out a step further in TS2000:  The timer doesn't reset when you 
go into another loop.

For example, I got an infinite loop runtime error after about 500 
cycles.  I was lazy, so I made copies of the loop so that each one would 
process less than 500 cycles to avoid any loop from timing out.  Well, I 
still got the infinite loop runtime error after 500 cycles.  I would like 
to avoid going the VB/DLL route on this one, so does anybody have any tips 
on how to use more complicated loops in EL so that it doesn't think it has 
an infinite loop?


Here's a proof:
first do this:


while value0 < 10000
	begin
		for value1 = 1 to 100000
			begin
			end;
		fileappend("c:\debug\loopcheck1.csv", numtostr(value0,0) + newline);
		value0 = value0 + 1;
	end;

It got as far as 4200 before I got the error.

Then do this:


while value0 < 3000
	begin
		for value1 = 1 to 100000
			begin
			end;
		fileappend("c:\debug\loopcheck2.csv", numtostr(value0,0) + newline);
		value0 = value0 + 1;
	end;

while value0 >= 3000 and value0 < 5000
	begin
		for value1 = 1 to 100000
			begin
			end;
		fileappend("c:\debug\loopcheck3.csv", numtostr(value0,0) + newline);
		value0 = value0 + 1;
	end;



You'll still get the same runtime error and value0 will still give the 
same!  Keep in mind that the number will be different depending on your 
computer.