Skip to content

Category: Tips

sort code tips and tricks

Tip: SQLite in RAM … to improve speed!

It’s very usual to use encrypted SQLite databases in our Xojo projects where we expect to get the maximum read speed from them. But the truth is that encrypting the data in these databases can introduce a penalty in our queries, both from read and writing/updating data to them. How can we improve this? One technique is the creation of a new in-memory based SQLite database, where we will be able to copy the table (or tables) we are interested in getting the maximum speed possible with. Continue reading to see how to do this.

Comments closed

#If vs. If and Conditional Compilation

There was a curious question on the forums about what # meant.

And from the way it was asked I could see the asker was thinking “I know what If means but what about that # in front of it?” And that if they knew what the # meant that the entire thing would make more sense.

And that’s a fair thought – except for one problem. The # by itself doesn’t “mean” anything. It isn’t like *, ^, + or – in that sense. It’s not an operator.

Comments closed

Some Follow-Up Regarding ByRef

A reader asked me to clarify something about my previous post. Their question was:

When MyMethod is written as:

Sub MyMethod( i() as integer )
  i = array(10,20,30)
  system.debuglog CurrentMethodName + " i(0) = " + str(i(0)) + " i(1) = " + str(i(1)) + " i(2) = " + str(i(2))
End Sub

What happens if instead of trying to assign a new array you just alter the values in the array passed in?

Comments closed

The Two-Finger Tap: Undo Gesture for iOS Apps

The only built-in gesture for undo on iOS at the moment is to shake the device. This is not very intuitive to me and I’ve certainly done it by accident many times. The makers of Procreate chose a two-finger tap and have found that their users adapted to it nicely. This gesture is being adopted by more and more iOS developers. Here’s all the code you need to implement the two-finger tap for undo in your Xojo iOS apps.

Comments closed

3 Things Developers Need To Release Their App Right

So you’ve created an app that you plan to sell, now you’re done, right? Nope, not even close! Developing your app is just step one. Marketing and promoting your app is the key to its commercial success, starting with announcing it. We talked to one successful Xojo developer who has several apps in the App Store. He told us that he spends 50% of his time on development and 50% of his time on marketing. Marketing. You think it’s just something for the Pros or people with a big offering, but it’s not.

Making sure everyone knows about your new app or latest update is really important. I have been in PR/Marketing for many years and have seen it all! The biggest mistake I see is developers forgetting to put a link back to their website or sitelet when talking about their app. In announcements and on social media it’s so important to make sure people can find you easily! Here are the 3 most essential steps you should take when announcing your app (or release) to the world.

Comments closed

Updating Code That Used The Graphics Property

Prior to Xojo 2018r3 Window and Canvas both had a Graphics property that you could access and draw to. This was deprecated in 2011 because it had significant performance issues on all platforms. The preferred way to draw your graphics since 2011 has been to use the Window.Paint or Canvas.Paint event handlers and the supplied parameter g As Graphics.

Starting with Xojo 2018r3, this Graphics property was removed from Window and Canvas so if you had code that was still relying on it, that code will no longer compile. Here are some tips on how you can migrate your code to use the Paint event handlers and tell the Canvas to update with a call to Invalidate.

Comments closed