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 21.6 ('Differences')
Instant purchase and download via GumRoad!


Sets and Zips

Trying out Xojo 2023r3's new features

Issue: 21.6 (November/December 2023)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 19,333
Starting Page Number: 67
Article Number: 21606
Resource File(s):

Download Icon project21606.zip Updated: 2023-10-31 23:51:23

Related Web Link(s):


Excerpt of article text...

I love how Xojo is regularly adding new language features. Two I hadn't expected in the latest update are support for sets and Zip archive files. I thought today I'd explore both of those.


I wrote about Sets in the past (see xDev 18.5, http://www.xdevmag.com/browse/18.5/18506/), using a custom SetClass class I wrote. But now with Xojo 2023r3, Sets are a standard part of the language. How does it compare?

Most importantly, note that my SetClass was limited to strings and only had a few functions. Xojo's implementation is far more powerful, using variants as its datatype so you can store just about anything into a set.

There are more comparison commands, too, such as complement and differences, in addition to the standard union and intersection.

There are also many more routines for getting data into and out of set objects. For example, you can use a set's fromDictionary method to bring in all the keys from a dictionary as items into that set. Likewise, there's a toDictionary command that exports the set items into a dictionary.

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