Am I having a brain freeze or are enumerations wonky?
In the App class I define a public enumeration :
Public Enum PathStatus
Quit
MissingFolders
HasFolders
End Enum
In the default window open event I do:
Sub Open()
Dim X as App.PathStatus
X = App.PathStatus.MissingFolders
End Sub
And App.PathStatus autocompletes as expected as does App.PathStatus.MissingFolders
BUT when I run I get the error :
This Item does not exist
X= App.PathStatus.Quit
where the highlighted portion is <X= App.PathStatus>
So is this a a huge bug or am I forgetting something obvious?
It’s more than that… i moved the enum into a window set it to public but accessing it via
Dim X as WindowName.Enum gives me not exists error… So I gave up and am using integer constants!
A Window will have the exact same problem when ImplicitInstance is turned on, for the exact same reason. The window name is a method that returns the singleton for that window.
Yeah, I personally hate implicit instantiation. I hate implied behaviors in general. I almost filed a feature request for a preference to turn it off by default, but it’s a setting that feels more appropriate on the project level rather than the preference level. Since settings like that don’t exist, a feature request feels kind of futile.
Perhaps changing the default template will help a little. Still creating a new window has implicit instance turned on by default.
So, project settings would be very helpful, but in lacking of this, a global preference would be good.