Class constants

I noticed that Xojo now allows constants to be defined for a user-defined class, similar to constants defined in a module, but I don’t find any documentation on how these can be used.

Evidently they can be used within methods of the same class, the IDE autocompletes and it compiles fine.

But… are these constants private to the class (ie accessible only in methods within the class) or can they be accessed globally ? e.g. something like:

someValue = myClass.kMyConstant

You determine the scope. You can read more about Public, Protected and Private scope in the documentation.

Ah thanks all solved - I had set them to PRIVATE :slight_smile:

Glad to hear it. Happy coding!