PDA

View Full Version : function repeat numLoopCount BUG!!


Solmos
12-04-2007, 04:46 PM
found a bug in the function of repeat numLoopCount ..

And is that if the total of times to repeat the function is more than 500, the application is blocked and does not respond, and when ending closes...

Example:

numLoopCount = 1;
repeat

File = ListBox.GetItemText("ListBox1", numLoopCount);
File.Delete(File, false, false, false, nil);

numLoopCount = numLoopCount + 1;
until numLoopCount == 600;


Any suggestions?

thx

bule
12-05-2007, 01:04 AM
Try this:

File.Delete(ListBox.GetItemText("ListBox1", numLoopCount), false, false, false, nil);

Solmos
12-05-2007, 07:33 AM
No, that's not the problem.

I have File.Delete as simple example, but whatever action you make repeated so often, the function is not working properly, it blocks the application (no response) and closes.

You might try putting Registry.Delete, file.copy or action you want, as long fault that role when you have 1ue repeated more than 500 times

Any suggestion or other function for repeat one fuction +1000 times?

thx

bule
12-05-2007, 08:25 AM
What happens if you use for loop?

Solmos
12-05-2007, 09:08 AM
Please one exmple

thx

bule
12-05-2007, 10:25 AM
local numLoopCount;
local File;

for numLoopCount = 1, 600 do
File = ListBox.GetItemText("ListBox1", numLoopCount);
File.Delete(File, false, false, false, nil);
end

Try using local whenever you can (but it is not required).

Solmos
12-07-2007, 02:43 AM
:yes:yes:yes

Bule very thanks, this code works perfect!!

thx