Hi,
First of all, replace the Wait function with a Wait until ms multiple function. This will give a more reproducible timing.
As to the event case ending after the iterations are done, I think this is automatically implied by your code. As soon as the code within the event case has executed, the event case is finished (unless it's in a loop, when it might be called again depending on user actions....).
You can also read out the current ms counter at the start of each loop to get the real loop start time if you want. Additionally, getting one at the end of the loop will enable you to find out approximately how long each loop takes. If this is close to, or more than your wait interval, you'll certainly have problems with your timing.
Hope this helps
Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)