PRB: Can't Set Certain DataTypes to Minimum Documented ValueLast reviewed: May 22, 1996Article ID: Q143422 |
The information in this article applies to: - Standard, Professional, and Enterprise Editions of Microsoft Visual Basic, 16-bit and 32-bit, for Windows, version 4.0- Standard and Professional Editions of Microsoft Visual Basic programming system for Windows, version 3.0
SYMPTOMSSetting a currency, long, integer, or double to its minimum documented value is not valid. If you hard code the value, then the error message: "INVALID Number" from Visual Basic 3, and "Expected: expression" from Visual Basic 4 displays. However, if you try set a variable of any of these types at run-time, an Overflow Error displays.
CAUSEThe reason for this behavior is that Microsoft Visual Basic reads all negative numbers first as their absolute value, and then applies a unary negative. Because Microsoft Visual Basic puts the absolute value into a placeholder of the type identified by the type suffix, it reports the error when the positive limit is exceeded.
RESOLUTIONNegative values that are greater in absolute value than the maximum positive value are invalid.
STATUSThis behavior is by design.
MORE INFORMATIONINTEGER: -32768% LONG: -2,147,483,648& CURRENCY: -922337203685477.5808@ DOUBLE: -1.79769313486232E308#
|
KBCategory: kbprg kbprb
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |