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 13.3 ('XDC 2015')
Instant purchase and download via GumRoad!

COLUMN

Column

Issue: 13.3 (May/June 2015)
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): 12,895
Starting Page Number: 67
Article Number: 13306
Resource File(s):

Download Icon 13306.zip Updated: 2015-05-18 09:57:47

Related Link(s): None

Excerpt of article text...

Last issue I wrote about class extensions as a way to become a Xojo power user. Today I'm going to explore a topic that few talk about, but one that is really powerful. Let's explore custom operators.

Comparing Objects

It's a very common thing to store data as objects. For instance, if you're writing an address book type of program, you might create a personClass object with that person's name, address and other details inside it.

What often happens when you start with data this way is that eventually you find a need to compare those objects. Is Object1 the same as Object2?

Xojo isn't very good at telling you this. You might think you can write if object1 <> object2 then but that won't do what you want it to do. That's because Xojo compares its internal reference to the object, not the object contents.

You can think of the reference as a unique, internal ID. So Object1 might have an ID of 7 and Object2 might have an ID of 19. To Xojo, they'd be different, even if they contained the exact same data.

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