It's a Saturday morning, and I gad a couple of minutes froo to explore something which has been bugging me for some time.
I have a module which declares and defines an Enum:
With pretty well every other declaration, the capitalization I use to define values and variables is cast in concrete at the point where I define/declare them.
As an example:
Then later on, no matter how I reference it (eg):
VBA will kindly impose the capitalization with which I defined it, and it shows up (after a split-second) as:
I like this. I can have fun with the declaration, and provided I get it 'right' (ie what I want to have be used everywhere), VBA will enforce it with nary a disapproving glance.
Not so with my poor old Enum (and occasionally with other constants). If I set up the declaration given above:
where are all the Option values are preceded by a lower case "o", then adopt my admittedly lazy way of referencing them, VBA simply allows whatever I use as the most recent reference to replace the original declaration:
changes the original declaration and the rest of the module - if not the project to the new capitalization. In defence of VBA all I can say is that it is equally non-judgmental, and does it silently without comment.
It makes debugging very difficult! And it looks ghastly.
Now - there is obviously some code somewhere in the IDE which 'normalizes' capitalization. It's just that it looks as if the lines of code are in the wrong sequence for this use case. I'm imagining something like:
But for this particular case we get:
Has anybody else noticed this? And does it bug you as much? And if so, how do you deal with it (except painfully to correct it after each egregious change)?
Bookmarks