CancelExtract
|
Previous Top Next |
:CancelExtract := {|Self, cTarget, nEntry, nFiles| ... } --> lCancel
|
Self
|
Self contains a reference to the XbZLibZip object itself.
|
cTarget
|
cTarget contains the Name of the Directory to which the Files are extracted.
|
nEntry
|
nEntry contains the number of Files that have already been extracted.
|
nFiles
|
nFiles contains the number of Files that should be extracted.
|
lCancel
|
lCancel determines if the Extracting of Files should be cancelled or not. If lCancel is .T. (TRUE), the process will be stopped and if lCancel is .F. (FALSE) the extracting of files will be continued.
|
During the Extracting of Multiple Files/Entries from the Zip File, the protected method :EventLoop() is called after each item has been processed. If the :EventLoop() method returns .T. (TRUE) -- which constitutes a request to Cancel the current process -- the protected :CancelExtract() method is called next, to allow the user to confirm that the process should really be cancelled or not.
|
|
By default, the :CancelExtract() method will simply display a Message Box that shows that the extracting of files to the target directory has been cancelled after File Number "nEntry" of "nFiles". This default behavior does not allow the user to actually cancel the original cancel request!
|
|
If the :CancelExtract Callback Slot contains a CodeBlock, that CodeBlock is instead executed. This CodeBlock may or may not allow the user to cancel the (original) cancel request. The expected Return Value of this CodeBlock must be logical, and determines if the extracting process should really be cancelled or not. Invalid (or missing) return values will default to .F. (FALSE), and the process continues.
|
· | Standard, default behavior (Display Message and Cancel Extraction):
|
oZip:CancelExtract := NIL
|
· | Always Continue -- Disable Cancel and Don't Show any Message:
|
oZip:CancelExtract := {|oZ, cDir, nDone, nFiles| .f.}
|
· | Always Quit and Don't Show any Message:
|
oZip:CancelExtract := {|oZ, cDir, nDone, nFiles| .t.}
|
· | Call an interactive UDF (User-Defined Function) named "AskUser()", which should return either .T. (TRUE) or. .F. (FALSE):
|
oZip:CancelExtract := {|oZ, cDir, nDone, nFiles| ;
|
AskUser(oZ, cDir, nDone, nFiles)}
|