If you need to add compression to a VFP app, look no further than Craig Boyd's excellent VFPcompression.fll.
Free and fast, documentation and download are available at http://www.sweetpotatosoftware.com/SPSBlog/CommentView,guid,07ed8874-8781-4e76-878b-92b3f4cfc8b3.aspx#commentstart
Under certain circumstances, it's possible to utilise the callback feature to allow a user to cancel out of the current operation.
To enable this, try the following:-
Add two new properties .lCancel and .lUserDidCancel to an in scope object, say oObjectName
In the calling function/procedure/method put:-
Code:
[color blue]ZipCallBack([oObjectName.mZipStatus()])
ZipOpen([MyZipFile.zip],[C:\],.F.)
ZipFile([C:\SomeVeryLargeFile.txt],.F.)
IF oObjectName.lUserDidCancel
[tab]oObjectName.lUserDidCancel = .F.
[tab][/color][color green]&& Delete incomplete .zip file[/color][color blue]
ELSE
[tab]ZipClose()
[tab]ZipCallBack([])
ENDI[/color]
Add a command button or other suitable control to the app and in the .Click() event put:-
Code:
[color blue]oObjectName.lCancel = .T.[/color]
In the callback function/procedure/method, oObjectName.mZipStatus(), put:-
Code:
[color blue]DOEVENTS
IF oObjectName.lCancel
[tab]oObjectName.lCancel = .F.
[tab]IF MESSAGEBOX( ;
[tab][tab][Do you want to cancel?],;
[tab][tab][tab]4 + 32 + 0 ,;
[tab][tab][tab][Cancel operation]) = 6
[tab][tab]oObjectName.lUserDidCancel = .T.
[tab][tab]ZipClose()
[tab][tab]ZipCallBack([])
[tab]ENDI
ENDI[/color]
The above example works but you will need to determine for yourself under what other circumstances the methodology will work.