Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
USER INTERFACES >>  HOW CAN I CANCEL OUT OF A ZIP OPERATION?

  Chris Chamberlain
  Where is Chris Chamberlain?
 GL6 0PN
 United Kingdom
 Chris Chamberlain



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:-
ZipCallBack([oObjectName.mZipStatus()])
ZipOpen([MyZipFile.zip],[C:\],.F.)
ZipFile([C:\SomeVeryLargeFile.txt],.F.)

IF oObjectName.lUserDidCancel
    oObjectName.lUserDidCancel = .F.
    && Delete incomplete .zip file
ELSE
    ZipClose()
    ZipCallBack([])	
ENDI	


Add a command button or other suitable control to the app and in the .Click() event put:-

oObjectName.lCancel = .T.


In the callback function/procedure/method, oObjectName.mZipStatus(), put:-

DOEVENTS

IF oObjectName.lCancel
     oObjectName.lCancel = .F.  
     IF MESSAGEBOX(		;
            [Do you want to cancel?],;	
            4 + 32 + 0		,;
            [Cancel operation]) = 6
        oObjectName.lUserDidCancel = .T.
        ZipClose()
        ZipCallBack([])	
    ENDI
ENDI


The above example works but you will need to determine for yourself under what other circumstance the methodology will work.

FEEDBACK

9dFIZI3AFS @ 10/27/2014 11:44:53 AM
Marzie d985db8ce2808cdaafd987:d8b3d984d8a7d985d88c d8a7db8cd986 d985d8b4daa9d984 d8a8d8a7 d8aad8badb8cdb8cd8b1 d8a2db8c d9bedb8c d8a8d987 ip db8cdaa9 d9bed8b1d988daa9d8b3db8c d8b3d8b1d988d8b1 d8afd8b1 d8a2d985d8b1db8cdaa9d8a7( d8a7daafd8b1 d8a2d8afd8b1d8b3 d8a2d985d8b1db8cdaa9d8a7 d8a8d8a7d8b4d987) d8add984 d985db8cd8b4d987d8aad986d8b8db8cd985d8a7d8aa d985d8b1d8a8d988d8b7d987 d8afd8b1 Control panel -> internet opotin-> connections->LAN Settings->use proxy server for d8afd8b1 d8a7db8cd986d8acd8a7 d8a8d8a7db8cd8af db8cdaa9 ip -address , port d985d8b1d8a8d988d8b7 d8a8d987 d9bed8b1d988daa9d8b3db8c d8b3d8b1d988d8b1db8c d8afd8b1 d8a2d985d8b1db8cdaa9d8a7 d988d8a7d8b1d8af d8b4d988d8afd8a7db8cd986 d8a2db8c d9bedb8c d988 d9bed988d8b1d8aa d8b1d988 d985db8cd8aad988d986db8cd8af d8afd8b1 d8a7db8cd986 d8b3d8a7db8cd8aa d9bedb8cd8afd8a7 daa9d986db8cd8af!hidemyass.comd8afd8b1 d982d8b3d985d8aa proxy ip & port[]



Your Name: 
Your Feedback: 

Spam Protection:
Enter the code shown: