>Hi Martina,
>
>long time not seen. How is live? (^.^)
Many boys, much sex ;-) (eh no, I have not free time for boys)
>
>O.K.
>For the moment this is just gathering of information, not test here possible.
>
>Do you have an idea how to determine that the return is from "RETURN TO" rather then the normal RETURN?
>
>And for a button the idea would be to use KEYBOARD to inject the ESC? Or would this return from the CLICK event?
For canceling by any button you must change calculation methods (call DOEVENTS and test any public canceling flag)
If you use ON ESCAPE... you don't need change calculation method.
OK, examples...
SET ESCAPE ON
ON ESCAPE RETURN TO MainProc
DO MainProc
SET ESCAPE OFF
ON ESCAPE
PROCEDURE MainProc
?"START"
=ChildProc()
?"END"
PROCEDURE ChildProc
DO WHILE .T.
?TIME()
ENDDO
SET ESCAPE ON
ON ESCAPE RETURN TO MainProc
loObj=CREATEOBJECT("_test")
loObj.MainProc()
SET ESCAPE OFF
ON ESCAPE
DEFINE CLASS _test AS CUSTOM
PROCEDURE MainProc
?"START"
=this.ChildProc()
?"END"
PROCEDURE ChildProc
DO WHILE .T.
?TIME()
ENDDO
ENDDEFINE
MartinaJ
>
>Agnes
>[<><]
>>Hi Agnes,
>>
>>Try use ON ESCAPE RETURN TO ProcedureName
>>
>>
>>MartinaJ
>>
>>>Hi,
>>>
>>>following problem occurs to me:
>>>I have a method that controls the data generation for reports. This could be complex calculation. If the user selects the wrong range it could run for a while.
>>>The control is generic, controled by a table. The calculation methods are well tested and established, and there is a large number of it. The callstack of the calculation could be variable, the position of the generic control too.
>>>
>>>Now the user likes to stop the generation.
>>>
>>>Is there a chance to use ESC key and/or some button to stop the generation without changing the calculation methods?
>>>
>>>TIA
>>>
>>>Agnes