Message
 
To
26/11/2006 18:09:43
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Fórum:
Visual FoxPro
Category:
Programação, sintaxe e comandos
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
ID da thread:
01172519
ID da mensagem:
01172524
Views:
13
ESC interrupt the query when escape set on. After user response to continue or stop the query messagebox, query is continuing from interrupted point.




>Update: Actually I am not sure whether ESC will interrupt the query if there is an ON ESCAPE. Perhaps you must use something like SET ESCAPE ON, but then I am not sure how to detect whether the command was actually interrupted.
>
>>CANCEL doesn't interrupt the query - the query was already interrupted with the ESC key.
>>
>>You must just consider how you want to handle the interruption, for instance, tell the user that the query was interrupted and that the process can't continue:
>>
>>
>>if llInterrupted
>>  MessageBox("The process was interrupted.")
>>  return
>>endif
>>
>>
>>
>>>Is there any alternative command or technique instead of "cancel" command at the interrruptmessage procedure. Because "cancel" don't prevent the query it also quit the whole program. I want to cut only running query in case of necessity.
>>>
>>>Thanks in advance
>>>
>>>Altun
>>>
>>>
>>>
>>>cQryStr = "select * from customer where name like 'A%'"
>>>cEscState = set("escape")
>>>
>>>set Escape on
>>>ON ESCAPE DO interrruptmessage
>>>&cQryStr
>>>set Escape &cEscState
>>>
>>>
>>>
>>>*****
>>>procedure interrruptmessage()
>>>
>>>if messagebox("To stop the query  press 'OK', to continue press 'Cancel' button.", 1+32)=1
>>>        messagebox("Query cancelled", 0+16)
>>>	cancel		
>>>	return .F.
>>>else
>>>	wait window "Query is continuing." nowait	
>>>endif
>>>return .F.
>>>
>>>ENDPROC
>>>
Previous
Next
Responder
Mapa
View