Skip to content

Category: Tips

sort code tips and tricks

Guest Post: A Few Little Xojo Code Performance Tips by Eric Gibbon

Eric Gibbon has been using Xojo to develop bespoke cross-platform applications for Mac and PC and for the web for 15 years. He lives in Stamford, England, and is an active member of the Xojo UK User Group.

There’s an old programmer’€™s saying: If it works, leave it alone.€ But sometimes we have to go back to code that works to make it go faster, because it’€™s too slow.

Over time I have picked up some tips on how to get better performance from Xojo code. I have used these tips to improve old code running on all platforms and have seen big improvements. They are quick and easy to do.

Comments closed

Time for a Reminder to Backup Your Data

If you work with computers, having backups of your data is essential. This particularly came to light recently with people testing out Apple Music and discovering that it could make a mess of your iTunes library. In fact, this happened to me!

But “luck favors the prepared” and I had backups, so this Apple Music glitch only proved to be an annoyance and not a catastrophe.

In my case, I just restored my iTunes library from my Time Machine backup. But I know far too many people that don’t even have any type of backup system in place. I’m here to help.

Comments closed

Casting about in both 32 and 64 bit worlds

Consider the following code:

dim i64 as Int64 = 1234567
dim i32 as int32 = 7654321

i32 = Int32(i64) // cast
i64 = Int64(i32) // cast

i32 = Ctype(i64, Int32) // convert
i64 = Ctype(i32, Int64) // convert

It all seems reasonable enough. Not useful, but seems reasonable. Only one problem. It won’t compile. Why not? The two casts to int32 and int64 will fail. Now why is that?

Comments closed

Using Using

With Xojo 2015 Release 2, much of the new Xojo framework is now available for use in all project types. Because the new Xojo framework uses namespaces, you might want to take advantage of the Using command to help make your code easier to read and write.

But first, a brief aside about namespaces. The Xojo framework uses namespaces to provide better grouping of related features and to allow for classes with the same name to co-exist (Xojo.Core.Dictionary and Dictionary, for example). In fact, you can mix classic framework code and Xojo framework code together in the same method!

Comments closed