This is my first posting for support after working with Xojo for 3 or 4 years without major problem. I hope someone can point out what I’m doing wrong here. Here’s a description of the problem.
I’m working on an application with a lot of fixed length arrays - all with the same length.
I want to define the array length as a constant so that if it needs to be increased in the future, it’ll just be a one line change.
So, I’ve defined a public constant on the App:-
#tag Constant, Name = MAXELEMENTS, Type = Double, Dynamic = False, Default = “49”, Scope = Public #tag EndConstant
I can then do the following in code:-
Dim anArray(App.MAXELEMENTS) as Integer
No problems there.
I then try and define an object array property on a class (e.g. MyClass)
#tag Property, Flags = &h0
MyArrayProperty(App.MAXELEMENTS) As Integer #tag EndProperty
This gives a compiler error in Xojo:-
MyClass.MyArrayProperty(App.MAXELEMENTS) Declaration - “Self” does not mean anything in a module method MyArrayProperty(App.MAXELEMENTS) As Integer
Interestingly (or maybe not) this compiles under RealStudio and works fine.
I can’t reproduce this at all. I defined a constant in App, kUpper = 6, then a property in my new Class, Arr(App.kUpper) As Integer, and it compiles just fine. I can even rename my App object without an issue.
I’m actually using 2015 2.1 - due to some plug-in incompatibilities - but I’ve tried compiling under 2016 4.1 and 2015 3, and they both come up with this same strange compiler error (“Self does not mean anything in a module method” doesn’t really seem relevant for this error).
I have an old version of RealStudio (2012 2.1) and it compiles under that OK and works fine.
I’ll try 2017 1 tomorrow morning (I’m on European time). If that fixes it, I guess this will be a good time to sort out those plug-ins.