Who defined that ?

Sometimes its nice to be able to know what class defined a property or method. Introspection makes this mostly knowable.

The reason I say “mostly” is that something the introspection metadata does not tell you is if the property definition is local or inherited. So you cant tell for sure if a property in a subclass is one defined in the subclass or the inherited one from the superclass.… Read the rest

Handy Method Editor tips

Did you know that you can write, in the declaration pane for the method editor, the entire declaration and the editor will rip it apart for you ?

So instead of having type the name, tab, parameters, tab, return type, tab, select a scope you can type

Private Foo(i as integer) as string

and press tab or return and it will all get split into the right spots.… Read the rest

Friends

When you design classes you often make the properties they hold private or protected so outside code cant mess with the innards.

But what if you want to allow that – sometimes ?

This is the notion of a “friend”. Another class that you can literally say “yeah its ok I know them and it’s OK if they mess with my innards as they are my friend”.… Read the rest

Handy tip for Enums

Ever tried to copy an enum from some outside source like Apple, MSDN, etc and wanted to retain the comments they have about each value in the enumeration ?

You can !

Enum values can have comments in them like

Public Enum ConnectionOption
 adConnectUnspecified = -1 //    Default. Opens the connection synchronously (after).
 adAsyncConnect    = 16 // Opens the connection asynchronously (before).
Read the rest

Stupid IDE tricks

A question was asked the other day about “how can I list just all the Windows in my application” And that reminded me of something I added to the IDE some time back.

Advanced filters in the find field above the navigator. It has only a very short mention in the IDE user guide.

So if you want to find all the Windows in your application you can type something like this into the filter field

% type:Window

and press enter and you will see all windows and container controls listed (containers are window like objects hence why they are listed).… Read the rest

Exceptions vs error codes

This isn’t just a Xojo debate. API 2.0 is reported to use exceptions rather than error codes.

And I’m sure that once preliminary releases of a version with API 2.0 are out that this debate will start in earnest.

Personally I’ve used both. The biggest difference with how I’ve used exceptions in the past in other languages was their built in support for “checked exceptions“.… Read the rest

We expect

Very useful words to keep in the communication between any company and its customers. Its not a promise. Just a rough outline of what things you are planning to do.

Some companies use phrases like this to let their customer base know “hey this is what we think we are going to be able to deliver” without having to promise a specific quarter or date.… Read the rest