PRB: Non-Reserved Word w/ Colon Behaves Differently in VB 4.0Last reviewed: October 30, 1995Article ID: Q129935 |
The information in this article applies to:
SYMPTOMSUsing Non-reserved keywords followed by a colon may produce different results in Visual Basic version 4.0. A reserved keyword in Visual Basic cannot be used as the name of a user-defined function. However, a non-reserved keyword may be used as the name of a user-defined function. In Visual Basic version 4.0 a non-reserved word followed by a colon is interpreted as a line label. Previous versions of Visual Basic checked to see if this is a statement followed by another statement on the same line. Similar behavior occurs when you use a user-defined subroutine with no parameters followed by a colon and another statement.
RESOLUTIONTo avoid the confusion that this could potentially cause, Microsoft recommends that you use colons only for line labels. Write each individual statement on a separate line. Not only does this allow you to avoid confusion, it also makes your code easier to read.
STATUSThis behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
|
Additional reference words: 4.00 vb4win vb4all
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |