The information in this article applies to:
SYMPTOMSWith the introduction of Visual Basic for Applications as the language used in Microsoft Visual Basic version 4.0, the plus sign (+) operator has undergone a minor change in behavior. CAUSEThe context rules used to determine whether to add or concatenate a mixture of variant and non-variant variables are now different. RESOLUTIONAlways use the ampersand (&) if you want to concatenate two strings. MORE INFORMATIONThe table listed below details the changes when adding or concatenating variant and non-variant data types. The main change is that if there is a numeric operand (rvalue) involved, Visual Basic will try to add the operands as numerics, coercing strings into numerics if possible. In previous versions of Visual Basic, the variant would be coerced into a string and concatenation performed. Example ScenarioIn this example, the following variables are declared:
Performing the following operations produces the following results:
* Notes:
Additional query words:
Keywords : kbprg kbVBp400 PrgOther VB4WIN vbwin |
Last Reviewed: October 25, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |