Lists a zip files contents.

Syntax

Result = SRP_Zip("GetFileList", ZipHandle)

Returns

1 if successful, 0 if not.

Parameters

NameDescription
ZipHandle Handle to an opened zip file.

Remarks

Call this service to get an @FM delimited list of items in from the zip file. The order of the items in the list will be in the same order they are stored inside the zip file, which means you can use the field number of this list as an index to ExtractFile or RemoveFile. For example, if "MyImage.bmp" is the third field in the list, then it's index of 3 can be used to extract or remove it. Note that each entry is a full path and file name of an item as it appears within the zip file.

Example

// Extract all files and save to a table (assuming table was previously opened)
hZip = SRP_Zip("Open", "C:\MyFile.zip")
If hZip EQ 0 then
   Call Msg(@Window, SRP_Zip("GetLastError"))
end else
   FileList = SRP_Zip("GetFileList", hZip)
   NumFiles = DCount(FileList, @FM)
   For i = 1 to NumFiles
       Data = SRP_Zip("ExtractFile", hZip, i)
       Write Data to hTable, FileList<i> then NULL
   Next i
   SRP_Zip("Close", hZip)
end
  • No labels