>Hi All,
>
>Is it possible to 'abort' some processing loop? I tried the code below (form method) to no avail:
>
>
>
>ON ESCAPE ThisForm.QuitProcess = .T.
>
>ThisForm.QuitProcess = .F.
>
>BEGIN TRANSACTION
>
>DO WHILE NOT ThisForm.QuitProcess
> * here, we do stuff like calculations, record inserts
>ENDDO
>
>IF ThisForm.QuitProcess
> ROLLBACK
>ELSE
> COMMIT
>ENDIF
>
>
>Thanks in advance!
Might be too obvious, but SET ESCAPE must be set to ON.
Another thing to be wary of is, I don't know if ThisForm is still in scope during processing of an ON ESCAPE handler. To check you could reference the actual name of the form i.e.
ON ESCAPE ActualNameOfForm.QuitProcess = .T.
or, you could set and use a PRIVATE or PUBLIC memvar rather than a form property (if only for debugging purposes).
Another thing you might need to check is if you've defined any code in the Form.KeyPress() or elsewhere that may get called.
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up