LOCAL lnCounter, done done = .F. lnCounter = 1 DO WHILE NOT done blah blah blah ... IF lnCounter%100 = 0 DoEvents() ENDIF lnCounter = lnCounter + 1 ENDDONow every 100th time through the loop a DoEvents() function call will occur. The DoEvents function tells VFP to go process the events that have been queuing up while the code was running. You don't want to DoEvetns() every time through the loop because it processes the fox events and the windows events and take time to do it. Doing DoEvetns every time through the loop will cause your code to run slower than molasis in January.