>In a modal form I have two commands button:
>in the first one i have a do while loop inside this i write a txt file.
>in the second one i try to cancel the loop process and close the form.
>The problem is that i can´t click in the second button (to cancel the loop process) until the loop is finished.
>Can you help me ?
>Thanks.
Add DOEVENTS() function call inside your loop. Then the click will be processed.
DO WHILE .T.
DOEVENTS()
IF [your exit condition here]
EXIT
ENDIF
ENDDO
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison