Skip to content

Aren’t those Xojo keywords?

Many times we get bug reports or feature requests about issues with keywords not highlighting or being colorized in the code editor. But are those words actually language “keywords” or reserved words in Xojo?

In reality none of the intrinsic types are reserved words. They’re just types in the global namespace. Xojo knows where a type name is required and it will only look for types in that context. The opposite holds true as well. In effect, the types are treated as if they live in their own namespace.

What that means is code like this, while possibly confusing to you and I, is perfectly legal:

Function String() As String
 Return "1"
 End Function

Sub Test()
 Dim string As String = String
 Print(string)
 End Sub

Test()

I wouldn’t necessarily encourage this style, but you can see why “the code editor isn’t highlighting these “keywords” is not wrong. Check the Developer Center for a full list of Xojo’s Reserved Words.