******************************************************************** * Description.......: Extract - used for extracting files from ZIP archive * Calling Samples...: * Parameter List....: tcDataDir, tcZipFile * Created by .......: Nadya Nosonovsky with Mark's comments * Modified by.......: Nadya Nosonovsky 04/27/2001 09:50:28 AM ******************************************************************** lparameters tcDataDir, tcZipFile *!* vartype tests should always come first. if the parameter *!* passed is not a character data type, the EMPTY() tests *!* can give you an error. if vartype(m.tcDataDir)<>'C' or empty(m.tcDataDir) && invalid parameter return .f. endif if vartype(m.tcZipFile)<>'C' or empty(m.tcZipFile) && invalid parameter return .f. endif tcZipFile = alltrim(m.tcZipFile) if not file(m.tcZipFile) && invalid file or invalid path to file return .f. endif local oZip oZip = newobject("DynaZip", "DynaZip.FXP") with oZip .cUnz_ZipFile = m.tcZipFile .cUnz_FileSpec = "*.*" .cUnz_Destination = m.tcDataDir * .lUnz_OverWrite = .t. && not needed. these are the default values .lUnz_Quiet = .t. * .lUnz_NoDirNames = .t. && not needed. these are the default values * .lUnz_Recurse = .f. && not needed. these are the default values * .lUnz_NoDirItems = .t. && not needed. these are the default values * .lUnz_CryptFlag = .f. && not needed. these are the default values * .lUnz_CryptCode = "" && not needed. these are the default values * .dz_Unz_Function = 8 && not needed. handled by UnzExtract method .lUSO_OverWrite_RO = .t. .lUSO_MinorCancel = .t. .lUSO_ExternalProg = .t. .lUSO_ExtProgCancel = .t. .cUnz_ExtProgTitle = "Extracting files from "+m.tcZipFile .lUnz_NoMsgs = .t. llSuccess = .UnzExtract() .release() endwith release oZip return m.llSuccess