Prepared statements

Had an interesting discussion the other day and in the course of the discussion the use of prepared statements came up. Turned out that a few people had never used them and did all the leg work to created their own mechanism to concatenate strings.

For a long time in REALbasic. and REALStudio this was a requirement.… Read the rest

Bin, hex and oct

Xojo’s BIN, HEX and OCT methods and their new counterparts, ToBinary, ToHex, and ToOctal should do a better job than they do.

If you pass in an 8 bit value you _may_ get an 8 bit binary representation back – or not. And this is true for ALL numeric types. The string you get back may not represent the full value esp if the upper bits are 0.… Read the rest

Things you should not rename in Xojo

There aren’t a lot of items in a Xojo desktop project that you can’t rename. You can change the name of the App instance, the default window, the default menu bar and many many others.

But there are a handful that, if you do rename them, you may inadvertently break your application. This is entirely due to how the Xojo framework works, and in part how macOS itself works.… Read the rest

New resources

This looks like it could be a nice forum as a place to learn about and discuss cross-platform app development, not specifically focused on Xojo (although that will be one of the topics I’m sure)

As an alternative to the Xojo forums where you cannot discuss other products etc this one is focused on cross platform – regardless of toolset

I’ll give it a chance.… Read the rest

If you’re updating with every release

A small handful of changes in 2019r3.1

Module Color
alpha changed to Integer
Function CMY(cyan As Double, magenta As Double, yellow As Double, alpha As Integer = 0) As Color

ColorGroup
gained operator_compare
Function Operator_Compare(otherColor As Color) As Integer

Module Crypto
added PBKDF2 with HashAlgorithms parameter
Function PBKDF2(salt As String, data As MemoryBlock, iterations As Integer, desiredHashLength As Integer, hashAlgorithm As HashAlgorithms) As MemoryBlock

Class DatabaseColumn
now has a destructor
Sub Destructor()

Class DatabaseRow
added Column setter method
Sub Column(name As String, Assigns value As Variant)

added Destructor
Sub Destructor()

Module String
new overloads for IndexOf
Function IndexOf(Extends s As String, startPosition As Integer, searchString As String, options As ComparisonOptions = ComparisonOptions.CaseInsensitive,… Read the rest

Creating custom controls

Xojo makes it possible for anyone to create custom controls for their projects. And its not really that hard. Yet many people don’t bother to take advantage of this capability and then try to place many independent instances on a layout and make several controls behave as though they are a single control.

This quick tutorial is aimed at trying to convince you that it really is worth investing the little bit of time required to create your own custom controls and then reuse them as many times as you want.… Read the rest

Subclasses are your friends

There are a LOT of things that you will hav a hard time doing if you only ever add instances of controls from the Library in Xojo to your layouts. And you will spend a LOT of time trying to sort out how to beat them into submission to do what you want with some combination of handling the events, properties and methods on your layout.… Read the rest

Why subclass ?

A recent discussion lead to an odd question. Why do you need to subclass things in Xojo ? Whats the point since they give you all these great controls and classes ? What would make you WANT to subclass things instead of just implementing the events of the existing controls ?

I was sort of surprised at this.… Read the rest

Try Catch Finally

Xojo supports the use of exceptions and the error handling machnisms that makes possible.

in order to use exceptions effectively you need to use a language feature called a Try block. It has several parts to it. First there is the initial TRY statement which opens a new scope level AND delimits where the TRY block starts.… Read the rest