Compiler issues I’ve reported

Over the past years iv’e reported a few compiler issues

Here’s the current list of open issues I’ve reported

55502 adding a constant to a class cant use an expression while one in code can
56376 compiler misidentifies syntax error on shared factory in super class
56378 factory pattern cant be implemented properly in Xojo esp when items are in a namespace
56765 compiler weird error message seems to be linked to wrong order of evaluation
57500 debugging a while loop in debugger appears to skip entire loop
58900 compiler incorrectly identifies unused local variables
59004 endexception constructor should probably be restricted in some fashion
59061 compiler gives a very ambiguous error message on select case statement
61901 compiler reports completely bogus error
61949 xojo does not warn of conversion on assignment
63438 compiler gets comparison confused with assignment
56264 make it so when a method returns an array you can immediately index into the return result
56272 optional parameters can only be “right most” parameters
60207 command line arguments for debug run cannot use a #constant

And there two I would love to see Xojo fix as its impossible for the usage to be ambiguous

56375 compiler incorrectly identifies “global” as syntax error
In something like an enumeration its impossible for the tokens for Global, Protected, Private and Public to be ambiguous.… Read the rest

A single set of libraries

This was asked on the Xojo forum

If the applications are developed by the same Xojo version, and all the exe files of several applications are placed in the same folder, is it possible for distribution purposes to have only one Libs folder ? In such case, which would be the name of this unique Lib folder ?

Read the rest

Save yourself some time

I see a lot of times people write code like

#if debugbuild
   system.debuglog "some message"
#endif

It means you type multiple lines of code all the time and if you forget to wrap things in the #if debugbuild then you have logging messages in your builds that maybe should have been turned off

Personally I have a module, named Debug, that has a method in it – Log

Then where ever I want a debugging message I can write

debug.log
Read the rest

Extending end of line

In Xojo EndOfLine is two things
One is a global method and the other a Class.

Because of how the compiler works it realizes when you mean each one.

In a line of code like

var eol as EndOfLine

EndOfLine can, in that context, ONLY be a TYPE name. So the compiler knows you mean the EndOfLine class.… Read the rest

The trouble with tribbles….

Or in this case linear gradients. If you want linear gradients to work well you really need to calculate the correct start and end points.

This is especially true if you dont want a gradient that simply runs from left to right or top to bottom (or their reverse directions)

While figuring out exactly what I needed to do I had several different suggestions from different people that I found dont work quite right.… Read the rest

Practices you may see in use but you’ll regret using

Some code looks enticing – but in the long run may cause you as many headaches as it solves.

Some is really innocuous looking like :

var position as integer = otherString.IndexOf(EndOfLine)
var leftChars as string = otherString.left(position)
var rest as string = otherString.Middle(position + 1)

There’s an assumption in this little bit of code and it may not be entirely obvious what it is.… Read the rest

Merry Christmas …

I dont know all the proper holiday greetings for everyone celebrating something at this time of year. For that I will apologize.

But it doesnt change my wish that everyone have the best holiday season this year especially after the crazy year we have all endured.

Yes. To everyone. Those who have helped me along the way.… Read the rest

Big Sur and Xojo

There’s a great debate about what versions of Xojo work on Big Sur.

IF you want to build DESKTOP apps you must use 2019r3.2 or later. Even an empty project fails to build properly.

They rely on a framework that Apple has removed and so the linking of them will fail.
Linking Executable ld: file not found: /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundationRead the rest

Why everything in a global namespace sucks

Alternatively – why Xojo should put everything in a Xojo namespace and NOT make anything global

I have a few projects that are the results of many many years of coding.

Updating them to the very latest version of Xojo ends up with lots of conflicts since Xojo added a String module with their own global extends for EndsWith and many others that have existed in other peoples code for years.… Read the rest

Inconsistent

In Xojo if you define a class and add a constant you can refer to that constant like

// suppose class1.kConstant is a string constant
dim v as string = Class1.kConstant

Basically you can refer to the Class type and access the constant.

Or you can do

// suppose class1.kConstant is a string constant
dim c as new Class1
dim v as string = c.kConstant
Read the rest