Article Preview
Buy Now
COLUMN
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):
project21606.zip Updated: 2023-10-31 23:51:23
Related Web Link(s):
http://www.xdevmag.com/browse/18.5/18506/
http://www.xdevmag.com/browse/21.2/21204/
http://www.tempel.org/rb/
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
andZip
archive files. I thought today I'd explore both of those.Sets
I wrote about Sets in the past (see
xDev 18.5,http://www.xdevmag.com/browse/18.5/18506/
), using a customSetClass
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, usingvariants
as its datatype so you can store just about anything into aset
.There are more comparison commands, too, such as
complement
anddifferences
, in addition to the standardunion
andintersection
.There are also many more routines for getting data into and out of
set
objects. For example, you can use aset
'sfromDictionary
method to bring in all the keys from adictionary
as items into thatset
. Likewise, there's atoDictionary
command that exports theset
items into adictionary
.
...End of Excerpt. Please purchase the magazine to read the full article.