Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 19.4 ('SpeedTest')
Instant purchase and download via GumRoad!

COLUMN

Archives in Xojo

How to Use Zip Archives

Issue: 19.4 (July/August 2021)
Author: Stefanie Juchmes
Author Bio: Stefanie studied computer science at the university in Bonn. She came in touch with Xojo due to the work of her brother-in-law and got a junior developer position in early 2019 at Monkeybread Software.
Article Description: No description available.
Article Length (in bytes): 5,528
Starting Page Number: 81
Article Number: 19408
Resource File(s):

Download Icon project 19408.zip Updated: 2021-07-01 11:16:32

Related Link(s): None

Excerpt of article text...

Archives are a very useful thing. Data can be compressed and sent by mail, for example. Did you know that you can also write archives with the MBS Xojo plugins? In a small example I would like to show you that today.

Let's start writing a Zip archive using the ArchiveWriterMBS class.

First, we create an instance of this class. In this object, we can set different properties and use methods. We want to create a Zip archive so we use the method SetFormatZip. Alternatively, we could also create a raw archive. In that case, we would use the method SetFormatRaw.

For compression, we can choose between Store and Deflate for Zip. With Store the file is not compressed, with Deflate an effective compression is applied. For this we call the suitable method ZipSetCompressionDeflate or ZipSetCompressionStore.

Now we want to define a place where we can store the Zip file later. For this, we create a folder item (e.g. on the desktop). The name of the file ends with the suffix .zip.

Afterward, we try to put a file into the Zip archive with the method CreateFile. If this fails, the process is aborted. Otherwise, we create an entry for the archive. This entry is an object from the class ArchiveEntryMBS.

...End of Excerpt. Please purchase the magazine to read the full article.