>SELECT mytable > >SCAN > **DO WATEVER > IF MDOWN() > DOEVENTS() > ENDIF >ENDSCAN > >>
LOCAL obtn, ncnt, x obtn = thisform.StopButton ncnt = 0 DO WHILE .t. * * Your processing code here * x = SYS(1270) IF MDOWN() AND TYPE('x')='O'AND obtn.Name=x.Name thisform.stopme = .t. * DOEVENTS && Note that DOEVENTS is not even needed! ENDIF IF thisform.stopme EXIT ENDIF ncnt = ncnt + 1 WAIT WINDOW NOWAIT 'Run Away '+TRANSFORM(ncnt,'')+'!!!!!' ENDDO STORE .NULL. TO x, obtn