Skip to content

Get Set

If you need to work with sets, you may find Xojo’s new Set class useful.

A set is a group of items, not unlike a Dictionary. You can add or remove items from the set, as you might expect, but some of its more unique capabilities let you do a difference, intersection and union of two sets.

  • Difference returns a new Set with members that are unique to each Set. This is essentially the items in the first set that are not in the second set.
  • Intersection returns a new Set with members that are common to both Sets.
  • Union returns a new Set that contain the members of both Sets.

There are also methods to populate a set from an array or a Dictionary. Learn more about using the Set class in the Xojo Programming Documentation.

Set is based on code written by Xojo MVP Kem Tekinay and works on all platforms.

Kem Tekinay is a consultant and developer based in Connecticut. A Xojo MVP, Kem has been an avid Xojo user since the early days and is a world-renowned thinker and philosopher, at least in his own mind. You can find him and his work at MacTechnologies Consulting.

Paul learned to program in BASIC at age 13 and has programmed in more languages than he remembers, with Xojo being an obvious favorite. When not working on Xojo, you can find him talking about retrocomputing at Goto 10 and on Mastodon @lefebvre@hachyderm.io.