Stepping away

I’ve had several people tell me they are “stepping away from Xojo” at the moment.

Most are users with many years experience in Xojo.

It’s disappointing that its come to this.

Anyone else had this said to them or doing this ?

Dynamic const or not ?

In the IDE you can create constants.

And if you create them as string constants you can set them to be “localized” or not.

This gives you the ability to support multiple different languages in a single build as the localized language files will be saved and used by your application.

But what happens to other kinds of constants if you add different instance values to ?… Read the rest

Select case vs if then

And how they work …..

In a bug report I made I posted a tiny sample of code

Dim tokens() As String

Select Case True
Case tokens.ubound < 0
Case tokens(0) = "End"
Case  "Dim"
End Select

(Not this code has a known bug in it – Case “Dim” is wrong but it illustrated the bug I was reporting) I’ve used this style for very long sections of code esp where I dont want to clutter it up with extraneous “if then” or “elseif”

But it gathered a curious comment that convinced me the writer of that comment isnt certain how SELECT CASE works.… Read the rest

Class vs Module

Should be a great WWE match up

Really the question was “should I use a class or a module?”

There’s not really global “Oh always use X” answer here.

But usually if you find yourself wiring code that passed data to a method and you have a group of methods that collectively define a “data type” then you probably want a class.… Read the rest

Working around things the IDE prevents

Sometimes when you want to subclass a control you want to retain the property name the Xojo control uses, but you want to add some custom functionality by putting a computed property in place in your subclass.

In the long run this makes your subclass a better drop in replacement. You dont end up with the case where the superclass has a property named one thing, like Text, and your subclass has a similar property named something else, like Caption.… Read the rest

Helping yourself debug

There are some really handy pragmas that can help you speed up your code a lot if you turn off the things they deal with.

Normally Xojo puts in extra checks to make sure you dont exceed array boundaries and dont overflow the stack on recursive calls. The list is on this page but I’ll repeat a few here

BackgroundTasks Enables or disables auto-yielding to background threads.In… Read the rest

Ptrs. And Memoryblocks. Oh My !

Sure I badly paraphrased the line from Wizard of Oz but this isn’t a word junkies blog. Or a Word© junkies blog either 🙂

Stupid tech jokes aside this one is about Ptr and Memoryblock and their interesting relationship.

In Xojo a memory block is just that – a chunk of memory acquired in one of many ways, that usually can be manipulated in lots of ways.… Read the rest