Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

Code Block
languagebp
// remove a single known file Extract all files and save to a table (assuming table was previously opened)
hZip = SRP_Zip_Open(("Open", "C:\MyFile.zip")
If hZip EQ 0 then
   Call   Call Msg(@Window, SRP_Zip_("GetLastError("))
end else
   FileIndex   FileList = SRP_Zip_FindFile("GetFileList", hZip)
   NumFiles = DCount(FileList, "MyImage.BMP"@FM)
   If FileIndex NE 0 then
       Data   For i = 1 to NumFiles
       Data = SRP_Zip_RemoveFile("ExtractFile", hZip, FileIndex)
   end
   SRP_Zip_Close(i)
       Write Data to hTable, FileList<i> then NULL
   Next i
   SRP_Zip("Close", hZip)
end