Hopefully our "class" modules can be updated to include a Class keyword in front of Sub to allow class helper methods. For those that don't quite understand what a class method is, it's basically a method that can be called independant of a specific instance of the class. For example, technically the "Initialize" is a "class" method since it isn't actually an instance of the class calling it.
Technically this is how the code should look to create an instance of a class:
The Initialize sub would look like this:
So essentially with a "Class" method, you would have some kind of helper routine you'd like to include within the class, but not necessarily require a specific instance of the class to call it
For example:
Technically this is how the code should look to create an instance of a class:
B4X:
Dim AInstance as CMyClass
AInstance=CMyClass.Initialize 'other languages might use the "New" keyword, i.e. AInstance=New CMyClass.Initialize
The Initialize sub would look like this:
B4X:
Class Sub Initialize()
'do something
End Sub
So essentially with a "Class" method, you would have some kind of helper routine you'd like to include within the class, but not necessarily require a specific instance of the class to call it
For example:
B4X:
'CMyClass
Class Sub GetANumber as int
Return 100
End sub
'somewhere in your app
Dim x as int
x=CMyClass.GetANumber