The Statelake function Zip produces a zipped output file from one or more source files. A zipped file is combined and compressed.

The first value aZipTargetFileName that is passed to the procedure, is the name and path to be given to the zipped output file.

Take care when providing the target output file name - if the output zipped file already exists, it will be overwritten.

The second value aSourceFileList is a list of the files to be zipped into the compressed output file. The list of one or more source file names must be in list/array notation, with square brackets at the beginning and end of the list.

Source files can be of any type such as text or binary, and different file types can be successfully zipped together.

If any of the files named in the source list do not exist, the zipped output file will still be created without producing an error - but may potentially be empty.

Declaration: Procedure Zip(aZipTargetFileName : string, aSourceFileList : array of string )

Example

procedure OnMapEvent(var Value:Variant);
begin
Zip('C:\Temp\TwoFiles.zip', ['C:\Temp\File1.txt','C:\Temp\File2.txt']);
end;