Results 1 to 1 of 1
2009-01-26, 14:55 #1
- Join Date
- Feb 2001
- Yilgarn region of Toronto, Ontario
- Thanked 0 Times in 0 Posts
Weird behaviour of runtime VBE (Excel2003)
We've all done this:<pre>Dim lngLevelThiskey As Long</pre>
while stopped on a break point or debug interrupt.
I felt the need for a LONG variable, so dimensioned one on-the-fly and inserted a line of executable code to make use of the variable.
VBE did not object, and I was able to continue execution.
Then (uh oh!) for aesthetic reasons I decided to capitalize my variable to lngLevelThisKey, and Excel2003/VBE did it's old "This action will reset your project, proceeed anyway?" trick.
I'm mildly puzzled.
The initial on-the-fly dimension statement must reserve space in the symbol table, allocate memory and all that wonderful behind-the-secnes stuff that an interpreter does.
Without a ripple of concern about the executing program.
But why should changing the case of a letter in the variable then cause a tidal wave of objection?
I expect(ed) there to be a change of one character in the symbol. In my case "k" to "K", but of course VBE must be considering that this is as naughty as "k" to "M".
And that would be not only the creation of a new symbol, but as well the removal of a symbol.
It's hard for me to comprehend why creating a symbol on the fly is alright, but changing or deleting one is not.
No big deal. Just something to haunt me until the day I die .....