Skip to content

Category: Learning

Control Subclass Constructors

A constructor is a special method that is used to initialize a class. They are very handy, but when you use them with control subclasses you have to be aware of how a control’s properties are initialized. Perhaps you’ve run into this situation:

“I have a constructor on my control and the values that I set in the constructor don’t stick.”

Comments closed

Make Your Own Classes Iterables

In programming, iterators are the mechanisms that allow us to walk all the members of a collection without needing to know in advance how many of them compose such a collection; and for that we can find in Xojo the commands For Each… Next. What are the main differences in comparison to the conventional For… Next?

The first difference is that with For Each… Next we can’t assume that we are iterating the members of the collection in order, as it is the case when using the variable of the conventional For… Next as the Index in order to access a known member of the collection. The second difference is that the iterator will be invalid when the iterated elements are modified, or when we modify the amount of elements in the collection during the iteration process.

By default in Xojo, there are a couple of collections that are iterable: the already mentioned Arrays and also Dictionaries and FolderItem.Children. Wouldn’t it be great to extend this feature so we can add this behaviour to our own classes making them more flexible? The key to making this happen is using the two Class Interfaces already included in Xojo: Iterator and Iterable.

Comments closed

Xojo and Community Growth in 2017

2017 has been a good year for Xojo! We hit some bumps but we’re ending the year with the much-awaited Xojo 64-bit IDE released in Xojo 2017r3.
Though we didn’t have a XDC in 2017, we’re gearing up for XDC 2018 in Denver in April. This is the longest between conferences in many years and we’re seeing an increase in early registrations. If you are planning on attending, please register soon. We have sold out before!
Comments closed

Compilers 102 – Parser

At XDC 2016 there was a lot of interest in Joe Ranieri’s Compiler session where he talked about compilers and LLVM. After talking with Joe we decided to put together a series of blog posts on compilers. These are at a high-level. None of these posts are going to teach you how to write a compiler. The goal of these posts is for you to have a basic understanding of the components of a compiler and how they all work together to create a native app.

This is the second post in our ongoing series on compilers. I recommend that you first read Compilers 101 – Overview and Lexer before continuing.

Comments closed

Compilers 101 – Overview and Lexer

At XDC 2016 there was a lot of interest in Joe Ranieri’s Compiler session where he talked about compilers and LLVM. I’ve already summarized a bit about LLVM in an earlier post, but after talking with Joe we decided to put together a series of blog posts on compilers.

These will all be at a high-level. None of these posts are going to teach you how to write a compiler. The goal of these posts is for you to have a basic understanding of the components of a compiler and how they all work together to create a native app.

Comments closed

Zoom Out: 8 Favorite, Fundamental Technology Books

Xojo offers the Introduction to Programming with Xojo textbook along with other resources like webinars, the Xojo Forum and the Dev Center. But sometimes you need a broader view, after all, coding isn’t all about the language. A good developer knows the importance of context, broad concepts and history.

These are some of my favorite technology, software and programming books:

Comments closed

Dates…What’s the difference?

Some days ago (or long, long ago, depending when do you read these lines) I received an email from a developer that was porting code from his old VisualBasic domain to the native, multi-platform Xojo. He asked me how can to get the difference between two dates? I’m pretty sure that most of you will have the answer, but I told him he’ll need Xojo.Core.Date and Xojo.Core.DateInterval. If you want to know how easy it is or how to get the same result for all your code based on the old date class, then I invite you to continue reading…

Comments closed