I have an enumeration named ‘foo’ defined in Session with an item ‘bar’ and the following code:
Dim t As Session.foo
t = Session.foo.bar
The compiler raises the error ‘This Item does not exist’ for the second line. I guess it’s because’Session’ is here the instance of the class, not the name of the class. Still, the compiler doesn’t blink on the first line. Why is that?
The first line it recognizes session.foo as a TYPE (because it has to be a type)
But in the second line session could be a function call (since there is a function called Session) OR a type and the compiler guesses the wrong one and tries to use the function “Session” which does not return anything that has a foo method.
In the case of App app it is, in the IDE the name of the class.
But at runtime it is also a function that returns the singleton for your app.
Rename “App” in the IDE to “myApp” and then you refer to app for the type but any time you need to get a reference to the singleton you use “App”.