PRB: Capitalization in Visual Basic 4.0 Differs from 3.0 (129712)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q129712 SYMPTOMS
Variable case is persistent after the first reference of the variable has
been set.
CAUSE
This happens because Visual Basic maintains a single name table for the
entire project where all names that are not case-sensitive are stored as a
single entry. This forces all occurrences of the same name, regardless of
where it is used (Sub procedure, parameter, dim, type, or whatever), to be
treated the same.
The names are based on where they are declared. The case of the name in the
last Declare statement always wins. Each name is tagged in the name table
with whether or not it has a corresponding Declare statement. If it does,
any access to the name from a statement that is not a Declare statement
causes the new name to have the same case as the name in the name table.
STATUS
This behavior is by design. This design brings Visual Basic for Windows
behavior more in line with the embedded version of Visual Basic,
Applications Edition in Excel and other Microsoft products.
Modification Type: | Major | Last Reviewed: | 12/9/2003 |
---|
Keywords: | kbprb KB129712 |
---|
|